1

Is it correct, that [T] and [Z] both characters indicate about UTC time format.

Furthermore [T] just split date and time parts?

var dates = [
  '2016-05-03',         // date only: UTC
  '2016-05-03Z',        // Z character: UTC
  '2016-05-03 00:00',   // exist time, missing T & Z: local
  '2016-05-03 00:00Z',  // exist Z: UTC
  '2016-05-03T00:00',   // exist T: UTC
  '2016-05-03T00:00Z'   // exist Z, T: UTC
];

dates.map(function(d) {  
  document.writeln(d + ':' + Date.parse(d) + '<br />');
});
Maxim Zhukov
  • 10,060
  • 5
  • 44
  • 88
  • For anyone else also reading up on these 2 characters, [here's another really good answer on the topic](https://stackoverflow.com/questions/30209941/what-t-and-z-means-in-date) – M - Dec 24 '21 at 02:55

1 Answers1

3

Yes, you're right:

The T is just a literal to separate the date from the time,

And the Z means "Zulu time" (UTC). From that post.

More on T and Z in wikipedia article on ISO 8601

If the time is in UTC, add a Z directly after the time without a space.

Community
  • 1
  • 1
shershen
  • 9,875
  • 11
  • 39
  • 60