输入日期如下:
清华5月17日6:00 GMT+0100 (北京时间)
然而,有以下几点:
var dateString = 'hu May 17 2012 18:00:00 GMT+0100 (BST)';
document.write($.format.date(dateString, "ddd MMMM dd, HH:mm"));结果输出比我预期的快1小时:
,5月17日,星期四,下午6:00
似乎忽略了GMT+0100的部分.
有什么办法让它显示在17:00吗?
发布于 2012-04-29 21:10:23
您必须显式地转换时区。您可以为它创建一个单独的函数。
请查看此链接:
http://www.techrepublic.com/article/convert-the-local-time-to-another-time-zone-with-this-javascript/6016329
https://stackoverflow.com/questions/10375935
复制相似问题