I am creating a system maintenance page that shows when system maintenance is performed. There is a progress bar on the page that shows which part of the service has been completed. I am trying to automate the progress bar by calculating the percentage / time remaining in the system maintenance window, but I am having problems.
There are three different times in the database, the start time, the end time, and then the current time. I need to sort out the remaining maintenance work time and show it in the progress bar coming from 1% to 100%. The script should be able to calculate how much time has passed between the start time and the end time.
At first I tried to calculate the percentage between two times (current time and end time), but that would not work, because there should be three factors in the equation: start time, end time and current time.
Any help on this would be appreciated.
source
share