How to get a zulu timezone representation of the current date

时光怂恿深爱的人放手 提交于 2020-01-06 02:27:08

问题


I would like to get the current date in ISO 8601 (rfc3339), Zulu format:

2015-10-13T10:26:43Z

How can I do this in Javascript?


回答1:


You can use toISOString()

var isoDate = new Date().toISOString();
console.log(isoDate);

Hope it helps,



来源:https://stackoverflow.com/questions/33100656/how-to-get-a-zulu-timezone-representation-of-the-current-date

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!