larryq
larryq

Reputation: 16309

what is this elasticsearch timestamp format?

I'm reverse engineering a query from a kibana board and it has timestamp values in it like '1408884022624'.

In reading over the elastic search date mapping docs I don't see anything in there regarding what (appears to be) some sort of millisecond or tick format. Could someone tell me what the number above represents in my query? (I'm pretty sure we're not using a custom date format.)

Upvotes: 0

Views: 1919

Answers (1)

John Petrone
John Petrone

Reputation: 27497

It's the number of milliseconds since the beginning of Unix Epoch time, 00:00:00 UTC January 1 1970. Sometimes referred to as Java Epoch time. Technically it's not Unix Epoch time as that's tracked as the number of seconds since the above date, but many tools/converters handle both seconds and milliseconds.

Care should be taken, though, as it's quite easy to accidentally get the time in one format (let's say seconds) and pass it to a function or method expecting it in the other.

http://en.wikipedia.org/wiki/Unix_time

http://www.javaworld.com/article/2074293/core-java/groovy--java--and-the-unix-epoch-time.html

Upvotes: 2

Related Questions