# Dropdown Datetimes from Dataset Displaying in Unix Time

**URL:** <https://forum.inductiveautomation.com/t/dropdown-datetimes-from-dataset-displaying-in-unix-time/105140>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [April 15, 2025, 8:48pm UTC](https://forum.inductiveautomation.com/t/dropdown-datetimes-from-dataset-displaying-in-unix-time/105140 "2025-04-15T20:48:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramsaran.j](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@ramsaran.j](https://forum.inductiveautomation.com/u/ramsaran.j)\
**Post date:** [April 15, 2025, 8:48pm UTC](https://forum.inductiveautomation.com/t/dropdown-datetimes-from-dataset-displaying-in-unix-time/105140/1 "2025-04-15T20:48:37Z")

</div>

Hello all,

I'm dealing with a strange issue. I have a dropdown whose options are populated by a dataset from a dynamically generated query. This particular field is a Date type from an Oracle database. When looking at the dataset directly, the rows display as correctly formatted DateTime types (in this case the label and value should be the same):

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/a/7a66fffa0e8f5f9fe53af0eb003408ef5ac32a47.png)

However, when the dropdown displays the fields, they output in Unix time:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/8/786d9cbf1165ad507ec983a385d38dc6829ae80f.png)

Additionally, when the user makes a selection, the value put into the Values array is also the Unix time value. I tried to apply transforms using the binding menu on the options field, but haven't found anything that works. Apologies if this is common issue, this is my first project using Ignition and I'm unfamiliar with a large majority of the program's features. Any help resolving this would be greatly appreciated.

---

<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:** [April 15, 2025, 9:10pm UTC](https://forum.inductiveautomation.com/t/dropdown-datetimes-from-dataset-displaying-in-unix-time/105140/2 "2025-04-15T21:10:25Z")

</div>

Browsers don't have fundamental datetime data types. So Ignition is forced to transmit timestamps in datasets or other date objects in the only loss-less format possible: the underlying UTC milliseconds.

Many Ignition components that expect datetime values automatically render them in the session timezone, and parse input in the session timezone. Other components, like the table, can be configured to recognize timestamps in specific columns.

The dropdown component doesn't have this capability. You will need to stringify the labels (not the values) for your user, applying the session time zone. This somewhat deep topic provides some tools for 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…

---

<div class="post-metadata">

**Author:** ![ramsaran.j](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@ramsaran.j](https://forum.inductiveautomation.com/u/ramsaran.j)\
**Post date:** [April 15, 2025, 9:16pm UTC](https://forum.inductiveautomation.com/t/dropdown-datetimes-from-dataset-displaying-in-unix-time/105140/3 "2025-04-15T21:16:49Z")

</div>

Thanks so much for the quick response. I looked at your code from the linked post and it looks straight forward. Where would I apply this transform in Ignition? I'm assuming I don't want to run this on the dataset itself, but instead somewhere between the dataset and what's displayed in the dropdown. Where would the appropriate place be to run this "middleware"?

---

<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:** [April 15, 2025, 9:19pm UTC](https://forum.inductiveautomation.com/t/dropdown-datetimes-from-dataset-displaying-in-unix-time/105140/4 "2025-04-15T21:19:31Z")

</div>

The linked post handles just a single timestamp. You will want to do this in a loop so you can convert all of the labels. This is commonly done in a script transform attached to the query binding. I normally prefer to move the query binding to a custom property and then use a `runScript()` expression binding to perform the conversion. (Using a function that does the looping in a project library script module.)

---

<div class="post-metadata">

**Author:** ![ramsaran.j](https://avatars.discourse-cdn.com/v4/letter/r/dfb087/32.png) [@ramsaran.j](https://forum.inductiveautomation.com/u/ramsaran.j)\
**Post date:** [April 16, 2025, 7:26pm UTC](https://forum.inductiveautomation.com/t/dropdown-datetimes-from-dataset-displaying-in-unix-time/105140/5 "2025-04-16T19:26:12Z")

</div>

Thank you for this explanation. I was able to follow your advice and it seems to be working as I need. Appreciate it greatly.
