# Logstash JDBC strange time convert

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-strange-time-convert/215760>\
**Category:** Logstash\
**Created:** [January 20, 2020, 2:51pm UTC](https://discuss.elastic.co/t/logstash-jdbc-strange-time-convert/215760 "2020-01-20T14:51:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![GaffaOverflow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gaffaoverflow/32/61066_2.png) [@GaffaOverflow](https://discuss.elastic.co/u/GaffaOverflow)\
**Post date:** [January 20, 2020, 2:51pm UTC](https://discuss.elastic.co/t/logstash-jdbc-strange-time-convert/215760/1 "2020-01-20T14:51:30Z")

</div>

Hi Everyone,  
Im trying to add Logs vom a MSSQL Database to my ELk-Stack.  
I had some trouble regarding the Timezone.  
I want a field with the UTC Time (will be the @timestamp field) i had problems with converting the field "requestdate" directly.  
So i added to the query the part  
RequestDate AT TIME ZONE 'UTC' AS UTCDate  
In the MS-SQL Server Managemnt Studio result i see the following  
 ![grafik](https://us1.discourse-cdn.com/elastic/original/3X/b/5/b5b4c4c52bf3c451b78a0f2dcb4340879184a8ec.png)  
When i copy the Query to the logstash conf file and execute them i get the resullts. All fields are correct, execpt the utcdate field.  
"utcdate":"2020-01-18T12:58:58.740Z"  
As you can see the date is exectly 2 days behind the real date in UTC.

in the conf file i have no filter and as output stdout { codec =\> json\_lines }

I hope you can help me.

Best

---

<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:** [February 17, 2020, 2:51pm UTC](https://discuss.elastic.co/t/logstash-jdbc-strange-time-convert/215760/2 "2020-02-17T14:51:41Z")

</div>

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