# Named Query Datetime Conversion

**URL:** <https://forum.inductiveautomation.com/t/named-query-datetime-conversion/76259>\
**Category:** Ignition\
**Created:** [July 12, 2023, 2:30pm UTC](https://forum.inductiveautomation.com/t/named-query-datetime-conversion/76259 "2023-07-12T14:30:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyler.kamyszek](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kyler.kamyszek](https://forum.inductiveautomation.com/u/kyler.kamyszek)\
**Post date:** [July 12, 2023, 2:30pm UTC](https://forum.inductiveautomation.com/t/named-query-datetime-conversion/76259/1 "2023-07-12T14:30:37Z")

</div>

I'm using some named queries in an expression binding to pull in data. These queries are using the formatted parameter of some date pickers for a date range.

I was expecting to have Ignition convert the datetimes to the gateway's timezone, similar to how a system.db.runPrepQuery reacts, but it does not. Probably because the Jython scripting is being used.

Should I just rewrite my bindings with a transformation script and run the named query that way?  
Or, is there a way to convert the user input datetime into UTC in the background?

---

<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:** [July 12, 2023, 3:12pm UTC](https://forum.inductiveautomation.com/t/named-query-datetime-conversion/76259/2 "2023-07-12T15:12:37Z")

</div>

> [@kyler.kamyszek](#):
>
> using the formatted parameter

This is likely the problem. Use the `.value` prop so you get a TZ-compliant object to pass to datetime value parameters of your named query.

---

<div class="post-metadata">

**Author:** ![kyler.kamyszek](https://avatars.discourse-cdn.com/v4/letter/k/a4c791/32.png) [@kyler.kamyszek](https://forum.inductiveautomation.com/u/kyler.kamyszek)\
**Post date:** [July 12, 2023, 3:17pm UTC](https://forum.inductiveautomation.com/t/named-query-datetime-conversion/76259/3 "2023-07-12T15:17:54Z")

</div>

Oh duh... That was it. Thank you.
