DEV Community

Discussion on: What is the *legit* way to get the current date and time of system ?

Collapse
 
bgadrian profile image
Adrian B.G.

One way would be to let the timer to be on server side and let it send you a push notification/trigger.

Other way would be to check the time on server and add the request time, from time to time.

When handling the time in a browser keep in mind

  • the interval can be negative, the user can change the hour, time minute and date during your timer
  • the browser can postpone/freeze your timers based on focus, CPU usage etc