# Elasticsearch / kibana wrong epoch date indexing

**URL:** <https://discuss.elastic.co/t/elasticsearch-kibana-wrong-epoch-date-indexing/129921>\
**Category:** Elasticsearch\
**Created:** [April 28, 2018, 2:32pm UTC](https://discuss.elastic.co/t/elasticsearch-kibana-wrong-epoch-date-indexing/129921 "2018-04-28T14:32:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehrdad22](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mehrdad22](https://discuss.elastic.co/u/mehrdad22)\
**Post date:** [April 28, 2018, 2:32pm UTC](https://discuss.elastic.co/t/elasticsearch-kibana-wrong-epoch-date-indexing/129921/1 "2018-04-28T14:32:11Z")

</div>

the elastichsearch or kibana is goeing wrong date from epoch index.

```
the date value is: 1495956650 (human date: GMT: Sunday, May 28, 2017 7:30:50 AM)

```

but...  
when indexing this record into elasticsearch with below mapping:

```
    PUT test
    {
        "mappings": {
        "doc": {
          "properties": {
            "date": {
                        "properties": {
                          "value": {
                            "type": "date"
                          }
                        }
                      }
              }
            }
          }
    }

```

when is post this data:

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

```

i see this date in kibana after index pattern, that is wrong!

```
date.value:January 18th 1970, 11:02:36.650

```

my elasticsearch and kibana versions both are 6.2.3  
and my system time is update.

---

<div class="post-metadata">

**Author:** ![mehrdad22](https://avatars.discourse-cdn.com/v4/letter/m/47e85d/32.png) [@mehrdad22](https://discuss.elastic.co/u/mehrdad22)\
**Post date:** [April 29, 2018, 4:22am UTC](https://discuss.elastic.co/t/elasticsearch-kibana-wrong-epoch-date-indexing/129921/2 "2018-04-29T04:22:22Z")

</div>

the problem is because of elastic wrong guessing format of epochs.  
in this situation format (epoch\_second) that's working.

```
PUT test
{
  "mappings": {
    "doc": {
      "properties": {
        "date": {
          "properties": {
            "value": {
              "type": "date",
              "format": "epoch_second"
            }
          }
        }
      }
    }
  }
}

```

thanks to [Olivier](https://stackoverflow.com/a/50080959/8674347)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 29, 2018, 5:14am UTC](https://discuss.elastic.co/t/elasticsearch-kibana-wrong-epoch-date-indexing/129921/3 "2018-04-29T05:14:13Z")

</div>

Elasticsearch uses by default ms since epoch indeed.

---

<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:** [May 27, 2018, 5:14am UTC](https://discuss.elastic.co/t/elasticsearch-kibana-wrong-epoch-date-indexing/129921/4 "2018-05-27T05:14:14Z")

</div>

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