search

Home  >  Q&A  >  body text

javascript - About the problem that page time keeps accumulating

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

淡淡烟草味淡淡烟草味2753 days ago755

reply all(3)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-05-19 10:25:46

    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.

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-19 10:25:46

    Directly write the front-end to death, and let the time keep adding up from the time you write the static page

    reply
    0
  • PHPz

    PHPz2017-05-19 10:25:46

    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.

    reply
    0
  • Cancelreply