Moment timezone error with daylight saving disabled

Hello all!

I think I found a problem in a perspective's component datetime conversion with client and gateway in different timezones.

I have a machine running an Ignition gateway with the following Date & Time settings: Time zone set to (UTC-06:00) Mexico City and Daylight saving disabled.

I've also opened a designer session from another machine with a different time zone (in this case set to (UTC+01:00) Rome) and with the Project's General > Perspective > Project Timezone set to Gateway Timezone.

I believe the problem occurs when using any perspective component that handles datetimes, in this topic I'll show the behaviour of the DateTimeInput component.

Interacting with the component causes all of these errors seen in the perspective's external debugger:


Most importantly, the component returns an incorrect datetime.
IncorrectSetup

We can verify this by checking the datetime in milliseconds shown just under the component in the previous screenshot (checked the timestamp on Epoch Converter).


When selecting 8 AM, 6th of november I expect the gateway to perform all operations with the same date, instead the gateway will be working with a datetime that is off by 7 hours.

This problem seems to be caused by the Daylight saving option being disabled on the gateway's machine.

When enabling this option (and restarting the gateway service) selecting the same date as before on the component returns a different datetime, wich is the correct one.
CorrectSetup

Looking into the previously shown erros in the external debugger console, the problem might be caused by an incorrect usage of the moment.js library.

Relevant question I found on stack overflow:

Has anyone else had issues with the Daylight saving option being disabled? Is this a known issue in Ignition?

Thanks!

1 Like