开发者

Display current time country

开发者 https://www.devze.com 2023-03-09 01:23 出处:网络
Is there a official way to get and d开发者_Go百科isplay the current correct world gmt time. rather than the computer local time (which you can easily manupulate)

Is there a official way to get and d开发者_Go百科isplay the current correct world gmt time. rather than the computer local time (which you can easily manupulate)

want a trustworthy way to get the current time in hours/minutes. then i can calculate for different zones.

anyone have a good example??

i checked this site the accuraccy of this site is good but how...

thank you!


var date = new Date().getTime();
var diff = date.getTimezoneOffset()*60000;
var local_date = new Date(date-diff);

this way, you can get the universal time without any server side scripting. I hope this is what you needed.


See JavaScript NTP time

This person connects to a json service (http://json-time.appspot.com/time.json), which get the NTP time, and converts it to json.

0

精彩评论

暂无评论...
验证码 换一张
取 消