# Wrong Date & Time

**URL:** https://discuss.elastic.co/t/wrong-date-time/58928
**Category:** Kibana
**Created:** [August 25, 2016, 12:09pm UTC](https://discuss.elastic.co/t/wrong-date-time/58928 "2016-08-25T12:09:41Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jaykumar](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@jaykumar](https://discuss.elastic.co/u/jaykumar)
#### Post date: [August 25, 2016, 12:09pm UTC](https://discuss.elastic.co/t/wrong-date-time/58928/1 "2016-08-25T12:09:41Z")

</div>

Hi All,

I have been struggling to get correct date, time and time stamp in Elasticsearch. I thought Logstash might be messing up things but I don't think so.

**_RAW LOG:_**

date=2016-08-15 time=18:13:23

_ **Logstash configuration:** _

```
mutate {
	rename => ["date", "detectiontime"]
	add_field => { "fraction" => ".000" } # this is just to bring timestamp into standard format of ElasticSearch
	add_field => { "detectiontime" => "%{time}%{fraction}" }
	remove_field => "time"
	remove_field => "fraction"
	add_field => { "detectiontimestamp" => "%{detectiondate}T%{detectiontime}" }
}

```

**_stdout_**

```
       "detectiondate" => "2016-08-26",
       "detectiontime" => "17:19:32.000",
  "detectiontimestamp" => "2016-08-26T17:19:32.000",

```

**_Elasticsearch Template Mapping_**

```
"mappings" : {
            "_default_" : {
        "_all" : {"enabled" : false},
        "_source": { "enabled": true },
            "_timestamp": { "enabled": true},
                    "date_detection" : false,
                    "dynamic": true,
        "properties" : {

                                            "detectiondate": {
                                                    "type": "date",
                                                    "format": "strict_date"
                                            },

                                            "detectiontime": {
                                                    "type": "date",
                                                    "format": "strict_hour_minute_second_fraction"
                                            },

                                            "detectiontimestamp" : {
                                                    "type": "date",
                                                    "format": "strict_date_hour_minute_second_fraction"

```

},

**_Kibana Display_**

detectiondate August 25th 2016, 05:30:00.000  
detectiontime January 1st 1970, 22:49:32.000  
detectiontimestamp August 25th 2016, 22:49:32.000

**_ElasticSearch JSON_**

"detectiondate": "2016-08-25",  
"detectiontime": "17:19:32.000",  
"detectiontimestamp": "2016-08-25T17:19:32.000",

Problem statement:

1. Why Kibana is showing date in the detectiontime, time in the detectiondate fields?
2. How Kibana is converting time into some different values?

How do I make Kibana show exact JSON values?

Please help.

Regards,

Jay

---

<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: [August 25, 2016, 12:12pm UTC](https://discuss.elastic.co/t/wrong-date-time/58928/2 "2016-08-25T12:12:06Z")

</div>

Why don't you just use a date filter in LS with a pattern that doesn't have milliseconds? It'd save doing all that mutate work.

---

<div class="post-metadata">

### Author: ![jaykumar](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@jaykumar](https://discuss.elastic.co/u/jaykumar)
#### Post date: [August 25, 2016, 12:13pm UTC](https://discuss.elastic.co/t/wrong-date-time/58928/3 "2016-08-25T12:13:55Z")

</div>

Thanks for quick response.  
I tried that as well but problem is with Kibana showing wrong values.

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [August 25, 2016, 12:25pm UTC](https://discuss.elastic.co/t/wrong-date-time/58928/4 "2016-08-25T12:25:28Z")

</div>

By default Kibana adjusts timestamps to the browser's timezone. This can be disabled in the settings somewhere.

---

<div class="post-metadata">

### Author: ![jaykumar](https://avatars.discourse-cdn.com/v4/letter/j/439d5e/32.png) [@jaykumar](https://discuss.elastic.co/u/jaykumar)
#### Post date: [August 25, 2016, 12:27pm UTC](https://discuss.elastic.co/t/wrong-date-time/58928/5 "2016-08-25T12:27:18Z")

</div>

Thank you. Got it, I will find out that settings.

How about showing date in the detectiontime and time in the detectiondate fields whereas both of them doesn't have that information?

---

<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, 1:40pm UTC](https://discuss.elastic.co/t/wrong-date-time/58928/6 "2017-07-06T13:40:19Z")

</div>


