# Prevent UTC conversion for date fields

**URL:** <https://discuss.elastic.co/t/prevent-utc-conversion-for-date-fields/59468>\
**Category:** Elasticsearch\
**Created:** [August 31, 2016, 9:12pm UTC](https://discuss.elastic.co/t/prevent-utc-conversion-for-date-fields/59468 "2016-08-31T21:12:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![purnashree.b](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@purnashree.b](https://discuss.elastic.co/u/purnashree.b)\
**Post date:** [August 31, 2016, 9:12pm UTC](https://discuss.elastic.co/t/prevent-utc-conversion-for-date-fields/59468/1 "2016-08-31T21:12:42Z")

</div>

Hi,

I am syncing data from our SQL servers where dates are already stored in UTC timezone eg. 2016-09-01 03:00:00.000

Now when i sync this data to ES, it applies UTC on top of this UTC again.

How can I prevent UTC timezone conversion for the index? Will creating a dynamic\_template like below help and prevent UTC conversion when stored in ES?

POST /test  
{  
"mappings": {  
"test": {  
"dynamic\_templates": [  
{  
"dates\_ignore\_malformed": {  
"path\_match": "\*",  
"match\_mapping\_type": "date",  
"mapping": {  
"format": "yyyy-MM-dd HH:mm:ss.SSS",  
"ignore\_malformed": true  
}  
}  
}  
]  
}  
}  
}

---

<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:** [September 2, 2016, 2:08am UTC](https://discuss.elastic.co/t/prevent-utc-conversion-for-date-fields/59468/2 "2016-09-02T02:08:45Z")

</div>

ES will always store in UTC, you can't change that.

What is happening exactly, show examples of code and the results.

---

<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 5, 2017, 10:23pm UTC](https://discuss.elastic.co/t/prevent-utc-conversion-for-date-fields/59468/3 "2017-07-05T22:23:03Z")

</div>


