# Using a custom time format doesn't work

**URL:** https://discuss.elastic.co/t/using-a-custom-time-format-doesnt-work/185027
**Category:** Elasticsearch
**Created:** [June 10, 2019, 4:46pm UTC](https://discuss.elastic.co/t/using-a-custom-time-format-doesnt-work/185027 "2019-06-10T16:46:43Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Hiven](https://avatars.discourse-cdn.com/v4/letter/h/ac91a4/32.png) [@Hiven](https://discuss.elastic.co/u/Hiven)
#### Post date: [June 10, 2019, 4:46pm UTC](https://discuss.elastic.co/t/using-a-custom-time-format-doesnt-work/185027/1 "2019-06-10T16:46:43Z")

</div>

I'm really stuggling. My elasticsearch data and mapping is in this format:

**Data**

```auto
{
  "test" : [ {
    "data" : "119050300",
    "date" : "10:00 2019-06-03"
  } ]
}

```

**Mapping**

```auto
{
  "mappings": {
    "properties": {
      "date": {
        "type": "date",
        "format": "HH:mm yyyy-MM-dd"
      },
        "data": {
        "type": "integer"
      }
    }
  }
}

```

However it fails to actually identify it as a date, and convert it to a timestamp internally. Nor is it possible to use in Kibana. However, if I remove the time aspect and do this instead, it works fine:

**Data**

```auto
{
  "test" : [ {
    "data" : "119050300",
    "date" : "2019-06-03"
  } ]
}

```

**Map**

```auto
{
  "mappings": {
    "properties": {
      "date": {
        "type": "date",
        "format": "yyyy-MM-dd"
      },
        "data": {
        "type": "integer"
      }
    }
  }
}

```

Can someone please tell me how to include the time and not have it break.

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [June 12, 2019, 1:04pm UTC](https://discuss.elastic.co/t/using-a-custom-time-format-doesnt-work/185027/2 "2019-06-12T13:04:04Z")

</div>

your mapping does match your document. The document has a `test.date` field, but your mapping is mapped to a `date` field

---

<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 10, 2019, 1:04pm UTC](https://discuss.elastic.co/t/using-a-custom-time-format-doesnt-work/185027/3 "2019-07-10T13:04:07Z")

</div>

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