# Add a second t\_stamp to a dataset is failing

**URL:** <https://forum.inductiveautomation.com/t/add-a-second-t-stamp-to-a-dataset-is-failing/109904>\
**Category:** Ignition\
**Tags:** scripting, perspective\
**Created:** [August 18, 2025, 6:58pm UTC](https://forum.inductiveautomation.com/t/add-a-second-t-stamp-to-a-dataset-is-failing/109904 "2025-08-18T18:58:14Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [August 18, 2025, 9:22pm UTC](https://forum.inductiveautomation.com/t/add-a-second-t-stamp-to-a-dataset-is-failing/109904/4 "2025-08-18T21:22:56Z")

</div>

> [@drewdin](#):
>
> doing something wrong

If you _must_ manipulate time zone display yourself, you will suffer with `java.util.Date` and its subclasses (which includes `java.sql.Timestamp`) because they are zone-less objects. They parse and stringify in the JVM's default time zone, and you cannot use datetime arithmetic to correct this (produces subtle bugs).

Instead, create a `java.time.Instant`, and then a `ZonedDateTime` in the desired zone to print. That can be stringified reliably. (Use a date/time formatter for precise control.)

> [@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…

---

_[View the full topic](https://forum.inductiveautomation.com/t/add-a-second-t-stamp-to-a-dataset-is-failing/109904)._
