What is the Z ending on date strings like 2014-01-

2019-06-15 04:07发布

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.

3条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-06-15 04:22

Z is shorthand for the UTC timezone.

查看更多
迷人小祖宗
3楼-- · 2019-06-15 04:27

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

查看更多
仙女界的扛把子
4楼-- · 2019-06-15 04:38

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).

查看更多
登录 后发表回答