# Date format in Index template kibana

**URL:** https://discuss.elastic.co/t/date-format-in-index-template-kibana/276791
**Category:** Kibana
**Created:** [June 23, 2021, 12:59pm UTC](https://discuss.elastic.co/t/date-format-in-index-template-kibana/276791 "2021-06-23T12:59:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Nisha2297](https://avatars.discourse-cdn.com/v4/letter/n/d2c977/32.png) [@Nisha2297](https://discuss.elastic.co/u/Nisha2297)
#### Post date: [June 23, 2021, 12:59pm UTC](https://discuss.elastic.co/t/date-format-in-index-template-kibana/276791/1 "2021-06-23T12:59:08Z")

</div>

Can you please help me with the correct format for Date that I can give in my index mapping template to get the date in Epoch format.  
I am getting the date from source in epoch format like this "1624348829313". I want it in the same way in Kibana also.

---

<div class="post-metadata">

### Author: ![rashmi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rashmi/32/16391_2.png) [@rashmi](https://discuss.elastic.co/u/rashmi)
#### Post date: [June 23, 2021, 7:45pm UTC](https://discuss.elastic.co/t/date-format-in-index-template-kibana/276791/2 "2021-06-23T19:45:45Z")

</div>

> [@Nisha2297](#):
>
> th the correct format for Date that I can give in my index mapping template to get the date in Epoch f

Can you do a POST of the date and check how the format looks like?

For ex:

```auto
when is post this data:

    POST test/doc
    {"date": {
              "value": "1495956650"
            } 
    }

```

Elasticsearch uses by default ms since epoch.

> **[Date field type | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/date.html)**

---

<div class="post-metadata">

### Author: ![Nisha2297](https://avatars.discourse-cdn.com/v4/letter/n/d2c977/32.png) [@Nisha2297](https://discuss.elastic.co/u/Nisha2297)
#### Post date: [June 24, 2021, 3:39am UTC](https://discuss.elastic.co/t/date-format-in-index-template-kibana/276791/3 "2021-06-24T03:39:46Z")

</div>

Hi @rashmi ,  
I don't have permissions to use the Dev tools. Can you please suggest the format that I can apply in the index mapping template itself.

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [June 24, 2021, 5:31am UTC](https://discuss.elastic.co/t/date-format-in-index-template-kibana/276791/4 "2021-06-24T05:31:11Z")

</div>

Elasticsearch stores dates as epoch format, but will return them as ISO8601 ([from here](https://www.elastic.co/guide/en/elasticsearch/reference/7.13/date.html));

> Internally, dates are converted to UTC (if the time-zone is specified) and stored as a long number representing milliseconds-since-the-epoch.

I don't know how to tell Kibana to natively only show epoch, I can't find anything that does that as it's not really human-readable. The only way I can think would be to store the epoch time as a long and not a date and then use that. But again, it's not really friendly.

---

<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 22, 2021, 5:32am UTC](https://discuss.elastic.co/t/date-format-in-index-template-kibana/276791/5 "2021-07-22T05:32:10Z")

</div>

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