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

后端 未结 5 2028
忘掉有多难
忘掉有多难 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 01:49

    There will most likely always be a deviation between times attained between machines, but (I was wrong before) JavaScript Date() takes the UTC timezone as default.

    Usually when time is essential, it's best to simply use the Server time and apply timezone corrections to that in the output if required.

提交回复
热议问题