# Where does Curator get the current time?

**URL:** <https://discuss.elastic.co/t/where-does-curator-get-the-current-time/62600>\
**Category:** Elasticsearch\
**Created:** [October 10, 2016, 7:07am UTC](https://discuss.elastic.co/t/where-does-curator-get-the-current-time/62600 "2016-10-10T07:07:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mormaii](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mormaii/32/10790_2.png) [@Mormaii](https://discuss.elastic.co/u/Mormaii)\
**Post date:** [October 10, 2016, 7:07am UTC](https://discuss.elastic.co/t/where-does-curator-get-the-current-time/62600/1 "2016-10-10T07:07:24Z")

</div>

This is the action file I have set up:

```
actions:
  1:
    action: delete_indices
    description: >-
      Delete indices older than 3 hours. Ignore the error if the filter does not result in an
      actionable list of indices (ignore_empty_list) and exit cleanly.
    options:
      ignore_empty_list: True
      timeout_override:
      continue_if_exception: False
      disable_action: False
    filters:
    - filtertype: pattern
      kind: suffix
      value: varnishfront
      exclude:
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y-%m-%d-%H'
      unit: hours
      unit_count: 3
      exclude:

```

I wanted to know where does curator get the current "%Y-%m-%d-%H" to compare on what to delete and what not to.

---

<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:** [October 10, 2016, 2:43pm UTC](https://discuss.elastic.co/t/where-does-curator-get-the-current-time/62600/2 "2016-10-10T14:43:54Z")

</div>

It just captures UTC in that moment, and reverse translates that to the individual symbols used in strftime.

See: [https://github.com/elastic/curator/blob/4099e0f33e18d825c0265859a895e018dcd2631d/curator/utils.py#L985-L1019](https://github.com/elastic/curator/blob/4099e0f33e18d825c0265859a895e018dcd2631d/curator/utils.py#L985-L1019)

Specifically note `datetime.utcnow()`, as that's what is being used as the starting point.

---

<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 5, 2017, 10:13pm UTC](https://discuss.elastic.co/t/where-does-curator-get-the-current-time/62600/3 "2017-07-05T22:13:36Z")

</div>


