0

In javascript there is object new Date() it gives current time and date that may be picked by system clock

But when i move time next hours why it should take approx 45 seconds to update time in javascript?

Example:- current time is 10:46 but when I change my system clock to 11:46 it will take approx 45 seconds to update.

Janen R
  • 719
  • 9
  • 20
Tauqeer
  • 11
  • 1
  • 2
    On older Windows OS, changing the sytem time causes a windows service to update all other programs. This service runs with a minute's interval. But the biggest question here is **why would you do that, and why would this be a real issue**? – Koby Douek Jun 20 '17 at 04:55
  • I am testing graph change with respect to time, so that why i switch to different hours and it is taking 45 sec to update – Tauqeer Jun 20 '17 at 05:14

1 Answers1

0

Try this its working for me:

var dt = new Date();
var time = dt.getHours() + ":" + dt.getMinutes() + ":" + dt.getSeconds();
console.log(time);
John Moutafis
  • 18,296
  • 5
  • 55
  • 96
Chandrika Shah
  • 500
  • 5
  • 6
  • sir issue is that check first time then update system clock to next hour and then check it will take aprox 45 second.I want to know that why it take too much time to update – Tauqeer Jun 20 '17 at 06:41