# Display local time from UTC time in label component in perspective

**URL:** <https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [January 31, 2026, 12:43pm UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677 "2026-01-31T12:43:56Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cose\_Peter1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cose_peter1/32/79174_2.png) [@Cose\_Peter1](https://forum.inductiveautomation.com/u/Cose_Peter1)\
**Post date:** [January 31, 2026, 12:43pm UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/1 "2026-01-31T12:43:56Z")

</div>

Hi,  
I'm quering the UTC time from a named query and showing it on label component.

I have this binding on the label coponent but, it does not convert it into the local time.  
Am I doing something wrong?

 ![Screenshot 2026-01-31 at 6.05.01 pm](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/0/909f56f46b44c0933dc2107ae249cd2c3d207064.png)

---

<div class="post-metadata">

**Author:** ![Jasmine\_Quick](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jasmine_quick/32/80380_2.png) [@Jasmine\_Quick](https://forum.inductiveautomation.com/u/Jasmine_Quick)\
**Post date:** [January 31, 2026, 12:53pm UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/2 "2026-01-31T12:53:49Z")

</div>

Rather than a format transform, have you tried using an expression transform with the getTimezoneOffset() expression?

You would need to turn the {value} into a date first though. I think you could use fromMillis()?

---

<div class="post-metadata">

**Author:** ![Cose\_Peter1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cose_peter1/32/79174_2.png) [@Cose\_Peter1](https://forum.inductiveautomation.com/u/Cose_Peter1)\
**Post date:** [January 31, 2026, 1:00pm UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/3 "2026-01-31T13:00:51Z")

</div>

~~This seems to work.~~ This adds 30 mins more than actual time.  
Is this the best way of doing this?

 ![Screenshot 2026-01-31 at 6.29.20 pm](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/3/73a8145e90058ca6ede6f1d5d122bbc2a3b6e211.png)

---

<div class="post-metadata">

**Author:** ![Cose\_Peter1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cose_peter1/32/79174_2.png) [@Cose\_Peter1](https://forum.inductiveautomation.com/u/Cose_Peter1)\
**Post date:** [January 31, 2026, 1:25pm UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/4 "2026-01-31T13:25:38Z")

</div>

Okay, I understand why there is a 30 min offset. **getTimezoneOffset()** return value 5.5 in this case and **addHours()** rounds it up to 6.

But I can't figure out the right way to do this.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 31, 2026, 1:52pm UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/5 "2026-01-31T13:52:28Z")

</div>

> [@Cose\_Peter1](#):
>
> I'm quering the UTC time from a named query and showing it on label component.

Why? Why not use an expression binding of `now()`?

---

<div class="post-metadata">

**Author:** ![Cose\_Peter1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cose_peter1/32/79174_2.png) [@Cose\_Peter1](https://forum.inductiveautomation.com/u/Cose_Peter1)\
**Post date:** [January 31, 2026, 2:01pm UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/6 "2026-01-31T14:01:02Z")

</div>

My goal is to find the best method to display a timestamp from DB in local timezone in label component. Not really to display the current time.  
This was just an example that I tried to use to show the situation.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 31, 2026, 2:05pm UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/7 "2026-01-31T14:05:11Z")

</div>

Change your expression to `addMinutes({value}, getTimezoneOffset({value}) * 60)`

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [January 31, 2026, 7:33pm UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/8 "2026-01-31T19:33:30Z")

</div>

> [@Cose\_Peter1](#):
>
> My goal is to find the best method to display a timestamp from DB in local timezone ...

But why? Are you trying to check the DB server clock is correct? It seems strange.

---

<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:** [January 31, 2026, 11:56pm UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/9 "2026-01-31T23:56:42Z")

</div>

> [@Kevin.Herron](#):
>
> Change your expression

Ewwww! Kevin!

That will break around DST changes.

> [@Gateway Timezones and Script function behavior](https://forum.inductiveautomation.com/t/gateway-timezones-and-script-function-behavior/107050/4):
>
> NO Don't do arithmetic with dates to correct for time zones. java.util.Date objects are fundamentally UTC under the hood, representing a worldwide point in time, and trying to "adjust" them to correct for timezones simply makes them incorrect. If you pass incorrect timestamps to historian calls or other system functions, you will get wrong answers. These objects are stringified in the timezone of the JVM that does the string conversion, and are created by string parsing in the timezone of t…

Also:

> [@Ignition Perspective Page to show the client System date and time](https://forum.inductiveautomation.com/t/ignition-perspective-page-to-show-the-client-system-date-and-time/73265):
>
> Is it possible to display the client computer/system date and time on perspective web page? dateFormat(now(60000), "yyyy-MMM-dd HH:mm:ss a") showing the Gateway Server system date and time. Under Browse Tags-\> System -\> Client Tags are not available for Perspective sessions.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 1, 2026, 12:41am UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/10 "2026-02-01T00:41:24Z")

</div>

The getTimezoneOffset function is DST aware. There’s a raw version that isn’t.

---

<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:** [February 1, 2026, 12:58am UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/11 "2026-02-01T00:58:03Z")

</div>

Right, but it can be a different value before and after the arithmetic. That the arithmetic yields a `java.util.Date` with the wrong underlying UTC instant is just begging for later trouble.

---

<div class="post-metadata">

**Author:** ![Cose\_Peter1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cose_peter1/32/79174_2.png) [@Cose\_Peter1](https://forum.inductiveautomation.com/u/Cose_Peter1)\
**Post date:** [February 1, 2026, 7:53am UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/12 "2026-02-01T07:53:38Z")

</div>

I’m not trying to do anything like that. I’m describing a case where timestamps are stored in UTC in the database, but need to be displayed in the local time zone in the UI (Perspective).

For example, a **Products** table stores product details along with a **TimeCompleted** timestamp in UTC. When showing a product’s details in Perspective, I want **TimeCompleted** to appear in the local time zone instead of UTC.

---

<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:** [February 1, 2026, 2:34pm UTC](https://forum.inductiveautomation.com/t/display-local-time-from-utc-time-in-label-component-in-perspective/113677/13 "2026-02-01T14:34:19Z")

</div>

Use the techniques involving java's `ZonedDateTime` that I linked.
