# Time zones in Perspective

**URL:** <https://forum.inductiveautomation.com/t/time-zones-in-perspective/67957>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 23, 2022, 11:44am UTC](https://forum.inductiveautomation.com/t/time-zones-in-perspective/67957 "2022-12-23T11:44:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lautaro\_Cides](https://avatars.discourse-cdn.com/v4/letter/l/e47774/32.png) [@Lautaro\_Cides](https://forum.inductiveautomation.com/u/Lautaro_Cides)\
**Post date:** [December 23, 2022, 11:44am UTC](https://forum.inductiveautomation.com/t/time-zones-in-perspective/67957/1 "2022-12-23T11:44:28Z")

</div>

I have a problem here:  
on the same screen... how can I get the local time from my pc? I need to use this since the screen I am using could be opened in other countries.  
I have tried using system.date.now(). But it only returns me the local time of the server

---

<div class="post-metadata">

**Author:** ![iscrac](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/iscrac/32/49757_2.png) [@iscrac](https://forum.inductiveautomation.com/u/iscrac)\
**Post date:** [December 23, 2022, 12:50pm UTC](https://forum.inductiveautomation.com/t/time-zones-in-perspective/67957/2 "2022-12-23T12:50:40Z")

</div>

try with minus or plus timezone offset value exctracted from DataBase  
or get datetime from DataBase

---

<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:** [December 23, 2022, 1:42pm UTC](https://forum.inductiveautomation.com/t/time-zones-in-perspective/67957/3 "2022-12-23T13:42:32Z")

</div>

Don't use the database. That will give the database timezone. Use the Perspective Session property `timeZoneId`.

[https://docs.inductiveautomation.com/display/DOC81/Session+Properties](https://docs.inductiveautomation.com/display/DOC81/Session+Properties)

Application ideas here:

> [@\[IGN-6614\]What is the best way to format a date (milliseconds) for a specified timezone with Ignition's python scripting](https://forum.inductiveautomation.com/t/ign-6614-what-is-the-best-way-to-format-a-date-milliseconds-for-a-specified-timezone-with-ignitions-python-scripting/64068):
>
> What is the best/simplest way to format a date (milliseconds) to a string equivalent conforming to a specified timezone using python scripting? The [system.date.format() function](https://docs.inductiveautomation.com/display/DOC81/system.date.format) does not appear to provide capability to specify the timezone you want the output to conform to. I’m expecting that I am overlooking some simple build-in function. I’m looking for a general answer but my specific use case is that I’m attempting to return the results of a [system.tag.queryTagHistory](https://docs.inductiveautomation.com/display/DOC81/system.tag.queryTagHistory) request with added …

However, note that most Perspective Components will handle timezone conversions (including locale formatting) for you if you simply leave standard java datetime objects in your data (`java.util.Date` is built on milliseconds UTC), or provide long integer milliseconds-UTC in your data. In some components, like the table, you might have to request datetime formatting to engage this handling.
