# Milliseconds in timestamp for Curator

**URL:** <https://discuss.elastic.co/t/milliseconds-in-timestamp-for-curator/195433>\
**Category:** Elasticsearch\
**Created:** [August 16, 2019, 5:52am UTC](https://discuss.elastic.co/t/milliseconds-in-timestamp-for-curator/195433 "2019-08-16T05:52:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![NominaSumpta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nominasumpta/32/52412_2.png) [@NominaSumpta](https://discuss.elastic.co/u/NominaSumpta)\
**Post date:** [August 16, 2019, 5:52am UTC](https://discuss.elastic.co/t/milliseconds-in-timestamp-for-curator/195433/1 "2019-08-16T05:52:28Z")

</div>

Based on [this doc](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/fe_timestring.html), I composed a `timestring` based on the timestamp I send to Elasticsearch. I've gotten this far:

`%Y-%m-%WT%H:%M:%S.469436`

`469436` are milliseconds. How do I tell Curator about those? Or should I use regex (match all) to cover them?

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [August 16, 2019, 1:15pm UTC](https://discuss.elastic.co/t/milliseconds-in-timestamp-for-curator/195433/2 "2019-08-16T13:15:06Z")

</div>

`494` is milliseconds. That there are 6 orders of magnitude (microtude?) that means these are microseconds. Are you using [nanosecond resolution in Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/date_nanos.html)?

The official Elasticsearch documentation explains that [aggregations are only in millisecond resolution](https://www.elastic.co/guide/en/elasticsearch/reference/7.3/date_nanos.html#date-nanos-limitations), so this is probably unnecessary. Curator will handle the calculations properly because of this, and only does down to the second resolution itself.

---

<div class="post-metadata">

**Author:** ![NominaSumpta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nominasumpta/32/52412_2.png) [@NominaSumpta](https://discuss.elastic.co/u/NominaSumpta)\
**Post date:** [August 17, 2019, 11:10am UTC](https://discuss.elastic.co/t/milliseconds-in-timestamp-for-curator/195433/3 "2019-08-17T11:10:44Z")

</div>

You are right - they are not milliseconds. I've decided to use the `basic_date_time_no_millis` date format like this:

```
from datetime import datetime
        dt = datetime.utcnow()
        timestamp = dt.strftime('%Y%m%d')
        timestamp += dt.strftime('T%H%M%S')

```

Which results in a timestamp like `20190817T105422`. That lead to [another issue](https://discuss.elastic.co/t/change-timestamp-format-for-existing-index/195593) . I guess this format should work with Curator.

---

<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:** [September 14, 2019, 11:10am UTC](https://discuss.elastic.co/t/milliseconds-in-timestamp-for-curator/195433/4 "2019-09-14T11:10:51Z")

</div>

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