If javascript “(new Date()).getTime()” is run from 2 different Timezones

后端 未结 5 2039
忘掉有多难
忘掉有多难 2020-12-09 01:02

If JavaScript (new Date()).getTime() is run from 2 different timezones simultaneously, will you get the same value?

Will this value be affected by the s

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 02:01

    Yes, it's affected by system time. However, if the local time is correct (for whatever time zone the computer's set to), it should be the same in any time zone.

    The ECMAScript standard says (§15.9.1.1):

    "Time is measured in ECMAScript in milliseconds since 01 January, 1970 UTC."

提交回复
热议问题