We Value Your Feedback!
Could you please spare a few minutes to share your thoughts on Cloud Connected vs On-Premise Services. Your feedback can help us shape the future of services.
Learn more about the survey or Click here to Launch the survey
Schneider Electric Services Innovation Team!
EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-05-04 10:39 PM
Hi all,
Short version of my question: is it possible to get Geo SCADA to NOT adjust the DateTime colums when querying a Linked ODBC Table?
Long version: I am building a small SCADA system for a customer using the latest Geo SCADA (86.9210). They have an existing MySQL database which they want to keep (even though Geo SCADA could replace its functionality completely with custom tables). The tables in this database are a mix of static (information) and dynamic (logging when they perform major tasks etc,).
I have set up Geo SCADA to talk to the MySQL tables via Linked ODBC tables and can successfully query, insert, delete and modify from these tables. The problem is that the DateTime columns in the MySQL tables are stored in local time (Australian Eastern Standard Ttme). But Geo SCADA seems to assume that the data is stored in UTC and adds 10 or 11 hours to it (depending if DST is in effect) when displaying query results in ViewX. They don’t have issues with the missing/repeated hour during the DST change because they are never doing anything that will log data in the middle of the night (or on a weekend) when the change-over to/from DST happens.
One of the things that we will provide in the SCADA is mimics with embedded lists that query their MySQL data and they can filter the lists on DateTime and other columns. It is these lists that are displaying incorrectly (on DateTime) and I would like to get to match the actual stored data. The date displays fine if I query via MySQL Workbench. I have explored a few options to fix this:
Ideally, I would like Geo SCADA to treat any data to/from the Linked ODBC as local time and any query would display the data as it appears in the MySQL tables (not adjust it for local time in ViewX). Is there any way to get Geo SCADA to do this (maybe a registry setting?). Or else, are there any other suggestions to deal with this issue?
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-05-07 10:44 PM
So I did come up with a work-around for this on the MySQL side. It is a bit hacky, but it works. I will provide details here, even though it is not really a Geo SCADA solution.
For each table in MySQL that contains DateTime columns, I create a View in MySQL that queries the same rows, but converts the DateTime column to UTC. For Example:
CREATE VIEW ExampleTableGS AS SELECT Col1, Col2, CONVERT_TZ(DateTime, 'SYSTEM', '+00:00') AS "DateTime" FROM ExampleTable;
I then create another Linked ODBC table for each of these views. I use the View table when Geo SCADA needs to display the data in an embedded list and use the existing table when creating new rows (making sure to use local time for DateTime columns).
So essentially I am getting MySQL to take off 10H from each row, only for Geo SCADA to add it back on to end up with the same Date/Time. During daylight savings, it will be 11 hours but both systems have the same timezone, so will adjust automatically and the data should still be correct in Geo SCADA.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-05-05 04:35 PM
I don't have any MySQL to hand to test, but have you checked that MySQL isn't set to a default timezone of UTC? So when the date is queried it thinks it needs to add some hours?
It might be a case of changing my.cnf to have an updated default timezone but that may have a lot of consequences for other clients?
https://www.connectionstrings.com/mysql/ doesn't list any options for timezones
From a quick Google search I probably have found similar things to you, serverTimezone=UTC seems to exist in JDBC which may also work in the connection string for ODBC? Try it and see?
The following seems to have some interesting discussions on my MySQL and timezone
Nothing to specifically help, maybe just help you down a track.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-05-06 03:50 AM
Thanks for your response Adam. I did have a look into the timezone settings in MySQL before posting the question and it doesn't seem to be an issue.
Trying some of the commands in this Stack Overflow question (I am running these in MySQL command line client on the MySQL server):
https://stackoverflow.com/questions/2934258/how-do-i-get-the-current-time-zone-of-mysql
I tried running:
select now();
It returns the correct local date and time (AEST), matching the system clock.
I tried running:
select timediff(now(),convert_tz(now(),@@session.time_zone,'+00:00'));
It returns 10:00:00 which is the correct offset for AEST at the moment.
So the issue seems to be some sort of incompatibility between Geo SCADA linked ODBC tables and an SQL database with DateTime stored in local time. Unless I am completely missing a setting somewhere? At this stage the only practical solution seems to be to set the users to Use UTC time. But this will be super confusing for operators browsing the rest of the SCADA system.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-05-07 10:44 PM
So I did come up with a work-around for this on the MySQL side. It is a bit hacky, but it works. I will provide details here, even though it is not really a Geo SCADA solution.
For each table in MySQL that contains DateTime columns, I create a View in MySQL that queries the same rows, but converts the DateTime column to UTC. For Example:
CREATE VIEW ExampleTableGS AS SELECT Col1, Col2, CONVERT_TZ(DateTime, 'SYSTEM', '+00:00') AS "DateTime" FROM ExampleTable;
I then create another Linked ODBC table for each of these views. I use the View table when Geo SCADA needs to display the data in an embedded list and use the existing table when creating new rows (making sure to use local time for DateTime columns).
So essentially I am getting MySQL to take off 10H from each row, only for Geo SCADA to add it back on to end up with the same Date/Time. During daylight savings, it will be 11 hours but both systems have the same timezone, so will adjust automatically and the data should still be correct in Geo SCADA.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.
With achievable small steps, users progress and continually feel satisfaction in task accomplishment.
Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.
of