Why in Elasticsearch we have the 'Z' at the end of the date field?
For instance:
2016-05-16T00:00:00.000Z
What does it mean?
Is this something useful for anything?
Is it harmful?
Can I get rid of it?
What about joda time?
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 is T between date and time? The T is just a literal to separate the date from the time, and the Z means “zero hour offset” also known as “Zulu time” (UTC).
SSSZ or yyyy-MM-dd .
The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in ' YYYY-MM-DD hh:mm:ss ' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59' . The TIMESTAMP data type is used for values that contain both date and time parts.
1. Epoch_Millis format is a timestamp format that is used in Elasticsearch. Elasticsearch is a powerful search engine that can be used to index and search data in a variety of formats. One of the formats that it supports is the Epoch_Millis format, which is a timestamp format that is used in Elasticsearch.
What does it mean?
The 'Z' means UTC.
Reference:
https://www.w3.org/TR/NOTE-datetime
Try not to store local dates. If you want to find a good thread on dates and why you should use UTC check this thread.
Is this something useful for anything?
It is very useful, storing all dates in UTC allows for easy conversion of dates from locale to locale. It also allows for date comparison and date visualisations to be consistent.
Is it harmful?
No.
Can I get rid of it?
If you wish? I wouldn't recommend doing it... It's a bit like removing the currency field from a transaction. The transaction doesn't make any sense.
Another example with dates:
I rang my friend in Country X (+6 hours ahead) at 1pm December 24th 2016. For him it was 7pm. So we have two local date times.
One for me:
1pm December 24th 2016 in London
One for my friend:
7pm December 24th 2016 in Country X
If I delete the 'in ...' Part these two become become two instances of time 5 hours apart of each other. Which means we couldn't have possibly spoken on the phone? Right?
No, because they are the same instance in time, across two locales.
What about joda time?
What about it?...
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With