# Read time out sql server different than trend in Ignition

**URL:** <https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861>\
**Category:** Ignition\
**Created:** [June 17, 2019, 10:05am UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861 "2019-06-17T10:05:46Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [June 17, 2019, 10:05am UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/1 "2019-06-17T10:05:46Z")

</div>

Hello,

I have some data in a MySQL server with timestamp. When I connect the data(datatype float) and timestamp (datatype datetime) to an easychart I see different timestamps. The time in ignition is exact 2 hours later. Do someone know how that is possible?

I use this format 2019-06-17 12:05:23

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [June 17, 2019, 5:19pm UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/2 "2019-06-17T17:19:12Z")

</div>

On the surface, and without knowing your system, I’d say there is a timezone difference between the database and the gateway.

---

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [July 2, 2019, 7:13am UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/3 "2019-07-02T07:13:54Z")

</div>

Excuse for the late reply.  
i have checked the server time and that is UTC+2 and that is correct. When i take a look into Ignition designer and go to help and then About Ignition Designer i see that that the Client and gateway Time zone is Europe/Belgrade[GMT+1:00]. How do i change the gateway timezone? I can not see it in the configuration tab in the gateway settings.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 2, 2019, 3:20pm UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/4 "2019-07-02T15:20:28Z")

</div>

The gateway gets its timezone from the system it’s running on; Java looks it up automatically when defining the locale. The simplest solution is to change the timezone settings on the server actually running the gateway, then restart the gateway.

If that’s not an option, or doesn’t work for some reason, you can also force the timezone directly by either specifying it in the `ignition.conf` file in `<install dir>/data/` as `wrapper.timezone=Europe/Berlin` _or_ in the `wrapper.java.additional` section as `wrapper.java.additional.5=-Duser.timezone=Europe/Berlin`.

See [here](https://wrapper.tanukisoftware.com/doc/english/prop-timezone.html) for more context.

---

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [July 3, 2019, 8:33am UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/5 "2019-07-03T08:33:19Z")

</div>

I run the server software and ignition on the same system, the system time is ok. I don’t understand that when I look into the database table the time is ok. But Ignition visualize the time 2 hours later.

I have tried to change the Ignition.conf file but when I save the file it is a .text file.

There is one thing I did when I configure the mysql database. In the extra connection properties I need to put this: ServerTimezone=UTC.  
because if I don’t I get error in the connection.

---

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [July 9, 2019, 1:09pm UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/6 "2019-07-09T13:09:44Z")

</div>

Do you know what is going wrong? I only can save the conf file as a .text file.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 9, 2019, 2:30pm UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/7 "2019-07-09T14:30:25Z")

</div>

Use a different text editor (ie, not Notepad) or switch the ‘save as’ dialog to use ‘All Files’ and then manually specify the full filename (`ignition.conf`).

---

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [July 11, 2019, 5:56am UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/8 "2019-07-11T05:56:30Z")

</div>

I have change the ignition.conf file but I still have the same problem.  
I have made a screenshot :  
 ![Timezone%20igition](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7b6726def5fa76bfa33f1bfcaeb1523de716da03.png)\

When I go to About Ignition Designer I get the same timezone: Europe/Belgrade [GMT+1]

---

<div class="post-metadata">

**Author:** ![PerryAJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/perryaj/32/3281_2.png) [@PerryAJ](https://forum.inductiveautomation.com/u/PerryAJ)\
**Post date:** [July 11, 2019, 3:08pm UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/9 "2019-07-11T15:08:19Z")

</div>

You still have a leading `#` character in the ignition conf entry. That results in the line being ‘commented out’, so it doesn’t actually get applied. Remove the `#` before `wrapper.java.additional.5=-Duser.timezone=Europe/Berlin` and restart the gateway and you should see it take effect.

---

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [July 31, 2019, 1:22pm UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/10 "2019-07-31T13:22:11Z")

</div>

I have change the gateway timezone but I have still the same problem.

---

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [August 6, 2019, 5:08am UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/11 "2019-08-06T05:08:51Z")

</div>

When I change the timezone in windows with -2 hours I have the right time in ignition but I thing that is not a good solution. I tried to change the timezone in ignition but it doesn’t work right. The timezone changed but the data is 2 hours later. I don’t understand what is wrong.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [August 6, 2019, 11:36am UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/12 "2019-08-06T11:36:20Z")

</div>

Have you checked the timezone / offset settings in MySQL?

> <https://stackoverflow.com/questions/930900/how-do-i-set-the-time-zone-of-mysql>

---

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [August 7, 2019, 9:16am UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/13 "2019-08-07T09:16:53Z")

</div>

Yes I have checked the timezone in MySQL, this is the same time as the windows time. when I look at the easychart is displays the right time on the x as, but I see no data. When I click right on the easychart and go to autorange --\> all axes I see the data 2 hours in the future.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 7, 2019, 12:24pm UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/14 "2019-08-07T12:24:36Z")

</div>

Open the query browser in the designer and run this query:

```auto
SELECT cast(current_timestamp as char) as mysqltime, current_timestamp as jdbctime;

```

That will provide some insight into your problem. I suspect you should be using the TIMESTAMP column type instead of DATETIME, as TIMESTAMP automatically handles time zones. (Storage is always UTC for TIMESTAMP.)

---

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [August 12, 2019, 9:40am UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/15 "2019-08-12T09:40:03Z")

</div>

When I do that I get this as a result:

Mysqltime: 2019-08-12 11:05:19

Jdbctime: 2019-08-12 13:05:19

It looks like that the jdbctime is not right.

I have tried to use a timestamp datatype but it makes no difference.

---

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [August 15, 2019, 7:19am UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/16 "2019-08-15T07:19:41Z")

</div>

Does someone have a solution to change the jbdc time? I have tried to change the extra connection properties in the database connection but that doesn’t work.

---

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [September 11, 2019, 6:41am UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/17 "2019-09-11T06:41:08Z")

</div>

Have nobody a solution?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 11, 2019, 12:14pm UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/18 "2019-09-11T12:14:28Z")

</div>

You may also want to check if there is an updated jdbc driver at some point, but I found this link for you.

That being said, if things are getting _into_ the database correctly, it would seem the jdbc driver is working correctly. 😕

> <https://stackoverflow.com/questions/7605953/how-to-change-mysql-timezone-in-a-database-connection-using-java>

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [September 11, 2019, 12:19pm UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/19 "2019-09-11T12:19:08Z")

</div>

> [@Mitchel.Gommers](#):
>
> There is one thing I did when I configure the mysql database. In the extra connection properties I need to put this: ServerTimezone=UTC.  
> because if I don’t I get error in the connection.

I think this may be at the heart of the issue. I don't recall ever having to do that when I used Mysql. What error does it give?

---

<div class="post-metadata">

**Author:** ![Mitchel.Gommers](https://avatars.discourse-cdn.com/v4/letter/m/2acd7d/32.png) [@Mitchel.Gommers](https://forum.inductiveautomation.com/u/Mitchel.Gommers)\
**Post date:** [September 11, 2019, 1:26pm UTC](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861/20 "2019-09-11T13:26:17Z")

</div>

Hello JordanCClark,

I have deleted the: ServerTimezone= UTC in the extra connection properties to see the error but I don’t get any error now and the problem seems gone. The strange thing is that I tried this in the past but then I get the error every time. Is it possible that the jdbc driver updates automatically?

Thank you for the help

[Next page](https://forum.inductiveautomation.com/t/read-time-out-sql-server-different-than-trend-in-ignition/25861.md?page=2)
