Where does JavaScript get a new Date() from?
Is it based on the client's local computers time settings or something else?
I can't find anywhere only where this is documented. https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Date
Given you don't need an internet connection to use JavaScript, it gets the current date & time (and by proxy, the UTC offset/locale) from the client's local environment. You can test this by changing your local clock.
Just remember to change it back..:)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With