System.date.now Timezone

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:

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.

1 Like