How to get current time with format example: 2018-01-22T11:48:39.396000Z in JavaScript?

Issue

I have a very basic question to ask but I can’t find it in Google and Stack Overflow too.

How to get current time with format example: 2018-01-22T11:48:39.396000Z in JavaScript?

Solution

Is this what you mean?

new Date().toISOString() // "2018-03-02T03:46:26.814Z"

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString

Answered By – wintermute

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published