# Time format for creating time-based indices

**URL:** <https://discuss.elastic.co/t/time-format-for-creating-time-based-indices/24636>\
**Category:** Logstash\
**Created:** [June 30, 2015, 3:28pm UTC](https://discuss.elastic.co/t/time-format-for-creating-time-based-indices/24636 "2015-06-30T15:28:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GordonM](https://avatars.discourse-cdn.com/v4/letter/g/977dab/32.png) [@GordonM](https://discuss.elastic.co/u/GordonM)\
**Post date:** [June 30, 2015, 3:28pm UTC](https://discuss.elastic.co/t/time-format-for-creating-time-based-indices/24636/1 "2015-06-30T15:28:45Z")

</div>

Where can I find the documentation on how to set my own date formats for time-based indices such as the default format of logstash-%{+YYYY.MM.dd}? I just want to know the proper syntax here. logstash-%{+xxxx.ww} is also mentioned as a variant in the elasticsearch output plugin docs ( [https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-index](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-index) ) for weekly log indices, but nothing else is mentioned.

---

<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:** [June 30, 2015, 4:10pm UTC](https://discuss.elastic.co/t/time-format-for-creating-time-based-indices/24636/2 "2015-06-30T16:10:44Z")

</div>

Logstash uses [JODA Time formatting](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html). Use those letters.

This link is provided with the [date filter documentation](https://www.elastic.co/guide/en/logstash/current/plugins-filters-date.html#plugins-filters-date-match) and also the [sprintf documentation](https://www.elastic.co/guide/en/logstash/current/configuration.html#sprintf). It seems like we should explicitly link to the sprintf documentation in the Elasticsearch output documentation.

---

<div class="post-metadata">

**Author:** ![GordonM](https://avatars.discourse-cdn.com/v4/letter/g/977dab/32.png) [@GordonM](https://discuss.elastic.co/u/GordonM)\
**Post date:** [June 30, 2015, 5:31pm UTC](https://discuss.elastic.co/t/time-format-for-creating-time-based-indices/24636/3 "2015-06-30T17:31:52Z")

</div>

Thanks for the quick response!

---

<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 6, 2017, 5:35am UTC](https://discuss.elastic.co/t/time-format-for-creating-time-based-indices/24636/4 "2017-07-06T05:35:58Z")

</div>


