Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

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!

Query Linked ODBC tabled in Local Time

EcoStruxure Geo SCADA Expert Forum

Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Remote Operations
  • EcoStruxure Geo SCADA Expert Forum
  • Query Linked ODBC tabled in Local Time
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
sbeadle
Kirk sbeadle Kirk
308
AndrewScott
Admiral AndrewScott
96
BevanWeiss
Spock BevanWeiss
91
AdamWoodlandToo
Lt. Commander AdamWoodlandToo
37
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Solved Go to Solution
Back to EcoStruxure Geo SCADA Expert Forum
Solved
Scott_SCADA
Crewman Scott_SCADA
Crewman

Posted: ‎2025-05-04 10:39 PM

0 Likes
3
242
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-05-04 10:39 PM

Query Linked ODBC tabled in Local Time

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:

  • Change their MySQL tables to store the data in UTC. This would be an annoying exercise as it is decades of data across a bunch of tables. I am also hesitant to take responsibility for making such a big change that isn’t really in the scope of this project.
  • Set all Geo SCADA users to “Use UTC time”. This does fix the queries, but causes other annoying issues because the times are wrong everywhere else, such as the Last Updated statistics of points/scanners in View Status.
  • Set any local client PCs to GMT timezone. This would probably fix the issue. But cause other issues.
  • Adjust the time as part of the query by subtracting the correct number of hours. This would probably work, but would make the queries take longer as it would need to do the calculation for every row and they may be displaying years or decades of data. Also, the number of hours (to substract) changes depending whether DST is active or not.

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?

Labels
  • Labels:
  • SCADA
  • ViewX
  • Tags:
  • english
  • scada
  • SCADA app
  • SCADA software
  • SCADA tutorial
  • Telemetry and SCADA
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic

Accepted Solutions
Scott_SCADA
Crewman Scott_SCADA
Crewman

Posted: ‎2025-05-07 10:44 PM

0 Likes
0
141
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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.

See Answer In Context

Reply

Link copied. Please paste this link to share this article on your social media post.

Replies 3
AdamWoodlandToo
Lt. Commander AdamWoodlandToo
Lt. Commander

Posted: ‎2025-05-05 04:35 PM

1 Like
1
209
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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

 

  • https://stackoverflow.com/questions/930900/how-do-i-set-the-time-zone-of-mysql
  • https://youtrack.jetbrains.com/issue/TW-55050/Make-sure-time-zone-is-handled-correctly-when-MySQL-JD...

Nothing to specifically help, maybe just help you down a track.

Reply

Link copied. Please paste this link to share this article on your social media post.

Scott_SCADA
Crewman Scott_SCADA
Crewman

Posted: ‎2025-05-06 03:50 AM

In response to AdamWoodlandToo
0 Likes
0
166
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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.

Reply

Link copied. Please paste this link to share this article on your social media post.

Scott_SCADA
Crewman Scott_SCADA
Crewman

Posted: ‎2025-05-07 10:44 PM

0 Likes
0
142
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

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.

Reply

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

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.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

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