# Moment timezone error with daylight saving disabled

**URL:** <https://forum.inductiveautomation.com/t/moment-timezone-error-with-daylight-saving-disabled/98265>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [November 6, 2024, 10:12am UTC](https://forum.inductiveautomation.com/t/moment-timezone-error-with-daylight-saving-disabled/98265 "2024-11-06T10:12:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pietropezzi](https://avatars.discourse-cdn.com/v4/letter/p/97f17d/32.png) [@pietropezzi](https://forum.inductiveautomation.com/u/pietropezzi)\
**Post date:** [November 6, 2024, 10:12am UTC](https://forum.inductiveautomation.com/t/moment-timezone-error-with-daylight-saving-disabled/98265/1 "2024-11-06T10:12:50Z")

</div>

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:

 ![DaylightOffConsole](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/d/9d1b605edeea0391e08fa99a265a868295539574.png)  
 ![DaylightOffDetail](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/8/d8b88f8101e813103f209156ced876f21d1f4eb1.png)

Most importantly, the component returns an incorrect datetime.  
 ![IncorrectSetup](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/f/8f0b031b149d174872d878d410a565a9d51f0713.png)

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](https://www.epochconverter.com/)_).

 ![IncorrectEpoch2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/d/8d1dedf33197255d5c1bd467a8cb3712049ec723.png)  
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](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/6/d63740bc9d6107489d1b268b990816982303f74d.png)

 ![CorrectSetupEpoch2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/1/d1a947d15ccd821b817a1425691daca18b124035.png)

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_:

> <https://stackoverflow.com/questions/54887433/moment-js-moment-timezone-format-date-with-gmt-0600-type-date>

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

Thanks!
