# The curse of dynamic dates

**URL:** <https://discuss.elastic.co/t/the-curse-of-dynamic-dates/177633>\
**Category:** Elasticsearch\
**Created:** [April 19, 2019, 2:14pm UTC](https://discuss.elastic.co/t/the-curse-of-dynamic-dates/177633 "2019-04-19T14:14:21Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![abdon](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abdon/32/9195_2.png) [@abdon](https://discuss.elastic.co/u/abdon)\
**Post date:** [April 20, 2019, 9:53am UTC](https://discuss.elastic.co/t/the-curse-of-dynamic-dates/177633/4 "2019-04-20T09:53:05Z")

</div>

No, I was not suggesting to change the "Z" in your input data. I was suggesting to replace the "Z" with an "X" in the date formats in your index template.

The following works for me:

```auto
PUT _template/tpl
{
  "template": "myindex.*",
  "mappings": {
    "dynamic_date_formats": [
      "basic_ordinal_date_time",
      "yyyy-MM-dd'T'HH:mm:ss.SX",
      "yyyy-MM-dd'T'HH:mm:ss.SSX",
      "yyyy-MM-dd'T'HH:mm:ss.SSSX"
    ]
  }
}

PUT myindex.1/_doc/1
{
  "my_date": "2018-12-23T04:48:08.123Z"
}

GET myindex.1/_mapping

```

Did you delete your index before you retried indexing your data? Index templates are only applied to new indexes, not to existing indexes.

---

_[View the full topic](https://discuss.elastic.co/t/the-curse-of-dynamic-dates/177633)._
