我使用下面的date对象从用户获得当前时间:
var currentdate = new Date();
return (currentdate.getDate() + "/"
+ (currentdate.getMonth()+1) + "/"
+ currentdate.getFullYear() + " @ "
+ currentdate.getHours() + ":"
+ currentdate.getMinutes() + ":"
+ currentdate.getSeconds());我的问题是currentdate从哪里获得时间?它会占用中央服务器的时间吗?来自世界各地的用户是否会同时执行上述代码以获得相同的值?
或者这是基于每个用户的,这意味着如果来自不同时区的两个用户同时执行这些代码,他们将根据他们的时区获得时间,因此代码返回不同的值?
https://stackoverflow.com/questions/59615904
复制相似问题