Where does JavaScript get a new Date() from

后端 未结 4 575
生来不讨喜
生来不讨喜 2021-01-11 16:37

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

4条回答
  •  旧时难觅i
    2021-01-11 17:32

    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..:)

提交回复
热议问题