Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Z ending on date strings like 2014-01-01T00:00:00.588Z

Im doing a fetch to get a date from a database in java (the date should always be 2014-01-01T00:00:00). I'm getting the following time returned: 2014-01-01T00:00:00.588Z.

My questions is, what is the "588Z" at the end? and would this number be different the retrieve was done in a different timezone? i.e. would the number 588 be a different number in a different time zone.

Thanks for any help I may get.

like image 208
J145 Avatar asked Jan 08 '15 12:01

J145


People also ask

What does Z mean in date string?

The Z on the end means UTC (that is, an offset-from-UTC of zero hours-minutes-seconds). The Z is pronounced “Zulu”.

What does Z mean at end of date?

The literal "Z" is actually part of the ISO 8601 datetime standard for UTC times. When "Z" (Zulu) is tacked on the end of a time, it indicates that that time is UTC, so really the literal Z is part of the time.

What does Z at end of timestamp mean?

The Z stands for the Zero timezone, as it is offset by 0 from the Coordinated Universal Time (UTC). Both characters are just static letters in the format, which is why they are not documented by the datetime.

Which date format ends with Z?

That is a date “YYYY-MM-DD” with the four-digit Year, two-digit month and two-digit day, “T” for “time,” followed by a time formatted as “HH:MM:SS” with hours, minutes and seconds, all followed with a “Z” to denote that it is Zulu format.


2 Answers

The Z stands for the zero UTC offset.

If the time is in UTC, add a Z directly after the time without a space.
Z is the zone designator for the zero UTC offset.
"09:30 UTC" is therefore represented as "09:30Z" or "0930Z", while "14:45:15 UTC" would be "14:45:15Z" or "144515Z".

The portion immediately before the Z translates into fraction of second; here, 588.

From your question above, 00:00:00.588 means "about a half second past midnight", with the last three digits after the period, 588, translating: milliseconds.

... more details here on (ISO 8601 standard).

like image 97
Adam Avatar answered Sep 28 '22 15:09

Adam


Z stands for UTC (that is GMT, but standard): http://en.wikipedia.org/wiki/Coordinated_Universal_Time

like image 38
motoDrizzt Avatar answered Sep 28 '22 16:09

motoDrizzt