A very informative article. Here are a few things I can add:
By setting the TZ
environment variable, one can run an InterSystems process in a time zone different from the system’s local time zone.
I am in Boston (currently Eastern Daylight Time):
$ iris session iris USER>WRITE $ZDATETIME($HOROLOG,3,1)," Boston = ",$ZDATETIME($ZTS,3,1)," UT" 2024-09-18 12:55:55 Boston = 2024-09-18 16:55:55 UT
$ TZ=America/Chicago iris session iris USER>WRITE $ZDATETIME($HOROLOG,3,1)," Chicago = ",$ZDATETIME($ZTS,3,1)," UT" 2024-09-18 11:57:22 Chicago = 2024-09-18 16:57:22 UT
You can even dynamically change a process time zone by using the “C” callout feature to call tzset()
with the new time zone.
The documentation mentions $ZTIMEZONE
for changing timezones, but this only works if both time zones change between summer and winter time at the same time, which occurs in Europe, but nowhere else.
A common problem seen by InterSystems support approximately twice per year is a system that becomes an hour off because it doesn't transition between summer and winter at the correct time. This is almost always the fault of a missing operating system update. We can supply a small “C” program to dump the current time zone rules for Unix, Unix-like, and OpenVMS systems and a PowerShell script for Windows systems.