javascript - About the problem that page time keeps accumulating
淡淡烟草味2017-05-19 10:23:46
0
3
775
Now there is a requirement to accumulate time on the page, indicating how many days, hours, minutes, and seconds the platform has been running stably. . . How can this be achieved, please God. . . . I would like to thank you
There needs to be an interface. Every time you refresh the page, you have to get how long it has been running so far, and then keep adding up the timestamp.
To make it simple, choose a time point, such as 0:00 on April 1, 2017.
Then you get the current time period, subtract the time point you set from the current time period, and you have a time. Just refresh every second.
Directly write the front-end to death, and let the time keep adding up from the time you write the static page
There needs to be an interface. Every time you refresh the page, you have to get how long it has been running so far, and then keep adding up the timestamp.