Question for time zone setting in Ignition gateway

Hello,

We want to use the date time and time zone info of external GPS device as data source for the Igniton project.
Is there any interface that could change the Ignition’s time zone dynamically?

BTW, we found that once we update the time stamp info (such as adjusting the minute value) of local host for the Ignition gateway, the updated date time info can be reflected on the running Ignition project automatically.

but if we update the time zone of the host ( running the Ignition’s gateway), the time zone info will not be updated in the running Ignition project. We have to restart the Ignition gateway to synchronize the time zone with host. Is there any workaround that can synchronize the time zone info of Ignition gateway without restart gateway?

Thanks in advance if anyone could give some comments

You could experiment with the static setDefault() method of TimeZone in a gateway script.

@pturmel
Thanks for you quick comments.
For your link of TimeZone,it’s Java API. Sorry that I’m not familiar with Java.
Does it something like below data in gateway script?

import java.util.TimeZone
setDefault()

Close. I’d do something like this:

from java.util import TimeZone
desiredTZ = TimeZone.getTimeZone('someTimeZoneName')
TimeZone.setDefault(desiredTZ)

Presumably, you’ll get the time zone name from your GPS device, somehow.

I don’t know if this will propagate throughout the gateway and to clients immediately, eventually, or at all.

1 Like

@pturmel really appreciate your help

Did you get this working? Currently I have a gateway whose time zone is different than the host's. Presumably someone corrected the host time zone after the gateway had started. I tried this script and the gateway time zone didn't change.

If it didn't work, you'll have to restart the gateway service.