Switching to a new time zone. How to display data with old time zone before this date?

Hello. I am in Kazakhstan. On March 1, the time zone in our country changed from UTC +6 to UTC +5.

Not to be confused with daylight saving time. No. We have completely switched to a new time zone.

It was like this: after the onset of March 1, the clock was moved back to 23:00 on February 29.

Due to this, we needed to save the previous values until March 1st with the old time zone UTC +6.

Because if we change the time zone on the PI Data Archive server, then all the data would show a timestamp 1 hour earlier.

Therefore, after reading the documentation, we found a way to solve this problem by generating a localhost.tz file in \PI\dat

 

I will try to describe our actions in great detail.

We did this using the utility pidiag -tz -ifrule time.txt -of localhost.tz

 

Here are the contents of the time.txt file:

# Time Zone name:
from utc+6 to utc+5
# TZ environment variable: <not set>
# Bias (offset) from UTC (TAI) time:
-21600
# January is standard / Northern hemisphere:
0
# Standard Time Name:
E. South America Standard Time
ESAST
# Daylight Time Name:
E. South America Daylight Time
ESADT
# StartYear, EndYear, Month, Week, Day, Time, Offset
2024, 2024, 3, -1, 1, 0, 3600

 

 

Then we changed the time zone in the OS settings and restarted the server.

We waited until March 1st arrived and, as expected, we saw in SMT and ProcessBook that data was again recorded from 23:00 to 00:00. As shown in the screenshot:

 


1.png
 

 

But then on the client computers, we noticed that the time was showing 1 hour earlier. That is, the rule written on the PI DA server in localhost.tz did not work on clients. We simply received offset values for the client time zone. And it is important for us that data recorded before March 1 does not change its timestamp.

 

Then we found a way to fix this - we had to place the same localhost.tz file in \PIPC\dat on client computers

This solved the problem for ProcessBook when the settings were set to use client time.

But for PI DataLink the problem was not solved. At the moment, if we specify to use client time in the PI DL settings, then the data is shown correctly only for values ​​recorded after March 1st. Previous values are shifted.

But if we select server time, then everything happens the other way around - Data before March 1 is displayed correctly, but after that it is displayed incorrectly.

 

Please help me how to solve this problem correctly, so that we can see values with the old time zone (+6) before March 1, and after March 1 with the new one (+5)?

 

Parents Reply Children
No Data