# Converting a dataset with system.dataset.toDataSet changes date to integer

**URL:** <https://forum.inductiveautomation.com/t/converting-a-dataset-with-system-dataset-todataset-changes-date-to-integer/77326>\
**Category:** Ignition\
**Tags:** python, perspective, ignition81\
**Created:** [August 3, 2023, 2:39am UTC](https://forum.inductiveautomation.com/t/converting-a-dataset-with-system-dataset-todataset-changes-date-to-integer/77326 "2023-08-03T02:39:16Z")\
**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 3, 2023, 1:44pm UTC](https://forum.inductiveautomation.com/t/converting-a-dataset-with-system-dataset-todataset-changes-date-to-integer/77326/4 "2023-08-03T13:44:22Z")

</div>

> [@pascal.fragnoud](#):
>
> My money is on representation

Concur.

You are trying to dictate the generic string representation of a `java.util.Date` object in your dataset. No can do. (Though you might place `java.sql.Timestamp` objects in their place--subclasses of `java.util.Date` that have a generic string representation closer to what you want.)

**Don't convert to string!** (In the dataset. Convert to string at the point of **display** only.)

String conversions are the source of endless grief and frustration.

For UI display purposes, consider this:

> [@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/converting-a-dataset-with-system-dataset-todataset-changes-date-to-integer/77326)._
