简体   繁体   English

如何获取当前日期的祖鲁时区表示

[英]How to get a zulu timezone representation of the current date

I would like to get the current date in ISO 8601 ( rfc3339 ), Zulu format: 我想以ISO 8601rfc3339 ),Zulu格式获取当前日期:

2015-10-13T10:26:43Z

How can I do this in Javascript? 如何使用Javascript执行此操作?

You can use toISOString() 您可以使用toISOString()

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

Hope it helps, 希望能帮助到你,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM