# System.date.now Timezone

**URL:** <https://forum.inductiveautomation.com/t/system-date-now-timezone/72478>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 14, 2023, 9:12pm UTC](https://forum.inductiveautomation.com/t/system-date-now-timezone/72478 "2023-04-14T21:12:47Z")\
**Posts on this page:** 1\
**Showing post:** 13

<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:** [October 17, 2023, 12:27pm UTC](https://forum.inductiveautomation.com/t/system-date-now-timezone/72478/13 "2023-10-17T12:27:45Z")

</div>

But `system.date.now()` _ **IS** _ UTC. If you need to convert strings to/from UTC everywhere in your gateway, set your gateway timezone to UTC. If you need to use a variety of time zones in gateway scripts (and Perspective scripts), you will need to ask java to render in a specific time zone instead of the gateway timezone. Some techniques:

> [@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/8):
>
> Sure. I recommend [DateTimeFormatter.ofPattern()](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/time/format/DateTimeFormatter.html#ofPattern(java.lang.String)). But I would move the complexity to a project script module with a DateTimeFormatter instance with your preferred pattern saved as a top level variable. Like so, perhaps: from java.time import ZoneId from java.time.format import DateTimeFormatter defaultFormatter = DateTimeFormatter.ofPattern("YYYY-MM-dd HH:mm") def zonedFormat(ts, zoneid, format=None): formatter = defaultFormatter if format is None else DateTimeFormatter.ofPattern(format) r…

Let me emphasize what I wrote in an earlier comment: `java.util.Date` _ **objects** _ are UTC milliseconds under the hood. They already _ **are** _ UTC. Java converts them to strings for **display** in the JVM's timezone. When a `java.util.Date` object is serialized and transmitted to a client or designer, it travels **as UTC**. And then gets stringified in a local time zone wherever the stringification happens.

---

_[View the full topic](https://forum.inductiveautomation.com/t/system-date-now-timezone/72478)._
