0

when I execute the following line in Node

 > let x = new Date()
 > x 

i get something like

2020-06-04T21:51:08.059Z

what is .059Z and how would it translate to GMT timezone?

nightograph
  • 2,179
  • 5
  • 31
  • 49
  • `059` are milliseconds while `Z` says that the time is UTC, for further reference on JavaScript Date, see [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) – VincenzoC Jun 04 '20 at 22:08

1 Answers1

1

"Z" is kind of a unique case for DateTimes. The literal "Z" is actually part of the ISO 8601 DateTime standard for UTC times.

    let x = new Date();
    let gmtZone = x.toGMTString();
    console.log(gmtZone)
Himanshu Pandey
  • 688
  • 2
  • 8
  • 15