# How to convert long number format datetime to datetime?

**URL:** <https://discuss.elastic.co/t/how-to-convert-long-number-format-datetime-to-datetime/91609>\
**Category:** Logstash\
**Created:** [July 3, 2017, 8:33am UTC](https://discuss.elastic.co/t/how-to-convert-long-number-format-datetime-to-datetime/91609 "2017-07-03T08:33:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sonnguyenit](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sonnguyenit](https://discuss.elastic.co/u/sonnguyenit)\
**Post date:** [July 3, 2017, 8:33am UTC](https://discuss.elastic.co/t/how-to-convert-long-number-format-datetime-to-datetime/91609/1 "2017-07-03T08:33:19Z")

</div>

I have a field that is datetime in long value: `"action_date":636346116012468640`  
So i want to use date filter to convert it to Unix date time:  
date {  
match =\> ["action\_date", "what is date format?"]  
}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 3, 2017, 8:58am UTC](https://discuss.elastic.co/t/how-to-convert-long-number-format-datetime-to-datetime/91609/2 "2017-07-03T08:58:46Z")

</div>

What does this value represent? Nanoseconds since some point in time...? Where does it come from?

---

<div class="post-metadata">

**Author:** ![sonnguyenit](https://avatars.discourse-cdn.com/v4/letter/s/e95f7d/32.png) [@sonnguyenit](https://discuss.elastic.co/u/sonnguyenit)\
**Post date:** [July 3, 2017, 9:02am UTC](https://discuss.elastic.co/t/how-to-convert-long-number-format-datetime-to-datetime/91609/3 "2017-07-03T09:02:11Z")

</div>

It's nanoseconds value: see from: [DateTime.Ticks Property (System) | Microsoft Learn](https://msdn.microsoft.com/en-us/library/system.datetime.ticks.aspx)

> The value of this property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001 (0:00:00 UTC on January 1, 0001, in the Gregorian calendar), which represents DateTime.MinValue. It does not include the number of ticks that are attributable to leap seconds.

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [July 3, 2017, 9:26am UTC](https://discuss.elastic.co/t/how-to-convert-long-number-format-datetime-to-datetime/91609/4 "2017-07-03T09:26:39Z")

</div>

Okay. I don't think the date filter supports converting from such timestamps.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 31, 2017, 9:26am UTC](https://discuss.elastic.co/t/how-to-convert-long-number-format-datetime-to-datetime/91609/5 "2017-07-31T09:26:47Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
