# MySQL and Ignition Date and Time mismatch

**URL:** <https://forum.inductiveautomation.com/t/mysql-and-ignition-date-and-time-mismatch/24845>\
**Category:** Ignition\
**Created:** [May 9, 2019, 4:10pm UTC](https://forum.inductiveautomation.com/t/mysql-and-ignition-date-and-time-mismatch/24845 "2019-05-09T16:10:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![apimente](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/apimente/32/4030_2.png) [@apimente](https://forum.inductiveautomation.com/u/apimente)\
**Post date:** [May 9, 2019, 4:10pm UTC](https://forum.inductiveautomation.com/t/mysql-and-ignition-date-and-time-mismatch/24845/1 "2019-05-09T16:10:07Z")

</div>

Hi Friends,

We’re using Inition 7.9.10 and MySQL 8.0.13. When we do the following query:

`SELECT NOW()`

We have different results in ignition and MySQL (Ignition is 1 hour behind). MySQL show the same time that the server.

Trying to understand what is going on, we kwow that MySQL uses the system time zone (SELECT @@session.time\_zone) and so is ignition.

Do you guys have any clue about it?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![brendan.curran](https://avatars.discourse-cdn.com/v4/letter/b/cdc98d/32.png) [@brendan.curran](https://forum.inductiveautomation.com/u/brendan.curran)\
**Post date:** [May 9, 2019, 4:14pm UTC](https://forum.inductiveautomation.com/t/mysql-and-ignition-date-and-time-mismatch/24845/2 "2019-05-09T16:14:29Z")

</div>

Im having issues with 8.0 with java timestamps. Yesterday they were 5 hours behind when writing to tags or an SQL database. If I printed the timestamp, it was correct, if I used it to write to the database or tag it was wrong. Something is really wrong with datetime data types in 8.0.

---

<div class="post-metadata">

**Author:** ![apimente](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/apimente/32/4030_2.png) [@apimente](https://forum.inductiveautomation.com/u/apimente)\
**Post date:** [May 9, 2019, 5:17pm UTC](https://forum.inductiveautomation.com/t/mysql-and-ignition-date-and-time-mismatch/24845/3 "2019-05-09T17:17:14Z")

</div>

Hi,

Do you have the same results with MySQL 5.7? I can’t do that test because my ignition is under a productive environment.

Greetings,

---

<div class="post-metadata">

**Author:** ![apimente](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/apimente/32/4030_2.png) [@apimente](https://forum.inductiveautomation.com/u/apimente)\
**Post date:** [May 9, 2019, 8:27pm UTC](https://forum.inductiveautomation.com/t/mysql-and-ignition-date-and-time-mismatch/24845/4 "2019-05-09T20:27:03Z")

</div>

Hi,

In the connection definition, We added the following configuration:

```auto
servertimezone=UTC-4;

```

I don’t like this solution but it’s working for now.

Greetings,

---

<div class="post-metadata">

**Author:** ![Faisal.Shibli](https://avatars.discourse-cdn.com/v4/letter/f/90db22/32.png) [@Faisal.Shibli](https://forum.inductiveautomation.com/u/Faisal.Shibli)\
**Post date:** [June 20, 2019, 2:27pm UTC](https://forum.inductiveautomation.com/t/mysql-and-ignition-date-and-time-mismatch/24845/5 "2019-06-20T14:27:45Z")

</div>

I have the same issue. Where exactly did you put the servertimezone=UTIC-4. I don’t see it…

---

<div class="post-metadata">

**Author:** ![apimente](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/apimente/32/4030_2.png) [@apimente](https://forum.inductiveautomation.com/u/apimente)\
**Post date:** [September 4, 2019, 9:11pm UTC](https://forum.inductiveautomation.com/t/mysql-and-ignition-date-and-time-mismatch/24845/6 "2019-09-04T21:11:15Z")

</div>

When you’re configuring the MySQL connection you have to add it:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b55ff12131372bbfc59c6e567facf50ab47e7757.png)  
You have to replace the “#######” by “servertimezone=UTIC-4”
