# Issue with timezone & gateway datetime

**URL:** <https://forum.inductiveautomation.com/t/issue-with-timezone-gateway-datetime/98897>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [November 20, 2024, 9:42pm UTC](https://forum.inductiveautomation.com/t/issue-with-timezone-gateway-datetime/98897 "2024-11-20T21:42:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [November 20, 2024, 9:42pm UTC](https://forum.inductiveautomation.com/t/issue-with-timezone-gateway-datetime/98897/1 "2024-11-20T21:42:16Z")

</div>

I'm in trouble with gateway datetime after a change of timezone at OS level (Windows 10).

1. The gateway (8.1.44) is running with timezone = CET (+1h GMT, e.g. 9pm)
2. I stopped Ignition service, changed the timezone to Europe/Moscow (+2h GMT, e.g. 11pm)
3. The OS time changed, as here:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/7/a73ffceaa99fbb6fdac9ef8d7e8ed38bd6256ce9.png)
4. I started up Ignition and at Gateway level is working properly, as in the following (also timezone, when showed):  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/f/cfe5cfd16c41dc67fd3468fa808c7e2642507a82.png)
5. Indeed at runtime (luncher) and in the designer the [System]Gateway/CurrentDatetime is still at +1h GMT, despite showing Timezone = Europe/Moscow:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/d/8dd6d1677fc614b6eebde0d299c32a725598a260.png)

Really in trouble and difficult to understand. The client is setting up machines for different countries/continents and it is a severe issue at my end. Can anyone help?

Thanks.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [November 20, 2024, 10:30pm UTC](https://forum.inductiveautomation.com/t/issue-with-timezone-gateway-datetime/98897/2 "2024-11-20T22:30:34Z")

</div>

The _string presentation_ of the `CurrentDateTime` tag is localized to the local environment (e.g. whatever computer launched the designer/client), so _when you are displaying as a string_, such as when looking at the tag in the tag browser, you're getting what appears to be the wrong time. But the actual underlying Java Date object represents an instant-in-time, in epoch milliseconds, and is accurately reflecting the system time of the gateway (based on your other screenshots).

Besides the _cosmetic_ appearance of this tag in the tag browser, what actual problem(s) are you noticing?

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [November 20, 2024, 11:14pm UTC](https://forum.inductiveautomation.com/t/issue-with-timezone-gateway-datetime/98897/3 "2024-11-20T23:14:45Z")

</div>

I need to use/show the gateway datetime as a formatted string from the datetime, independently from client locale.

I could substitute with a derived/expression tag, but I need a datetime datatype tag. It is used extracting hrs/min in several part as “gateway datetime” using datetime to string (both on scripts and expressions)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 20, 2024, 11:50pm UTC](https://forum.inductiveautomation.com/t/issue-with-timezone-gateway-datetime/98897/4 "2024-11-20T23:50:00Z")

</div>

Is this throughout the project? Can you not set the project to use gateway timezone everywhere? (Look in project settings.)

---

<div class="post-metadata">

**Author:** ![e.cutino](https://avatars.discourse-cdn.com/v4/letter/e/e5b9ba/32.png) [@e.cutino](https://forum.inductiveautomation.com/u/e.cutino)\
**Post date:** [November 21, 2024, 9:37am UTC](https://forum.inductiveautomation.com/t/issue-with-timezone-gateway-datetime/98897/5 "2024-11-21T09:37:24Z")

</div>

Thx all for the hits.

The problem is sorted out as per @pturmel hit, indeed there is not the problem!

In the whole project (not mine...) was forced always "Europe" as Timezone Behaviour.  
That was "moving" the time in respect of Gateway timezone, if changed.

In such a way, properly in respect of settings, neither the client-side now() function nor the CurrentDateTime (gateway) were consistent with expected results (client and/or gateway timezone).

All clear, all good. Thx again
