简体   繁体   中英

UTC String in node.js

I want to get a string in this pattern:

2015-11-17T17:34:01Z

moment().utc().format("YYYY-MM-DD[T]HH:mm:ss");

I tried every method, and all the time, the 'T' is cutted, and I get this result: "12/29/2015 14:08:43"

If I'll replace the T with another letter it will work. I even tried to replace a K letter with a T, but it's the same result.

Thanks!

you mean you want iso format ?

moment().toISOString();

even native date has it

new Date().toISOString()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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