Display current time country
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.
精彩评论