Date does not detect date change immediately from OS

0

I've done this little test with typescript and nodejs :

setInterval(() => {
      console.log(new Date());
}, 3000);

and while the script is running, I change the date in the system (Windows 10), and the script takes approximately 1 min to reflect the day change.

Can someone who has had this experience tell me if this behavior is "normal"?

and if this behavior is the same when a day change is made normally.

    
asked by Isai Alvarez 02.11.2016 в 19:28
source

1 answer

0

I was testing on my PC, which has Windows 10 the code that I leave below, you can try copying it, creating an .html and opening it with any browser. When I change the system time, the change is made immediately in the browser.

<script>

setInterval(function() {
    window.fecha.innerHTML = new Date();
}, 1000);

</script>

<p id="fecha"></p>
    
answered by 04.11.2016 в 04:27