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?
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.
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/Berlinor in the wrapper.java.additional section as wrapper.java.additional.5=-Duser.timezone=Europe/Berlin.
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.
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).
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.
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.
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.
Open the query browser in the designer and run this query:
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.)
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.
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?