# Ignition Min and Max Date From Dataset

**URL:** <https://forum.inductiveautomation.com/t/ignition-min-and-max-date-from-dataset/18499>\
**Category:** Ignition\
**Created:** [June 17, 2018, 10:24am UTC](https://forum.inductiveautomation.com/t/ignition-min-and-max-date-from-dataset/18499 "2018-06-17T10:24:34Z")\
**Posts on this page:** 1\
**Showing post:** 7

<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:** [November 19, 2021, 2:10pm UTC](https://forum.inductiveautomation.com/t/ignition-min-and-max-date-from-dataset/18499/7 "2021-11-19T14:10:08Z")

</div>

If by SQL you mean MS SQL Server, then yes, you are [expletive]. Its timezone-aware column type, DATETIME2, is not generically supported by JDBC. So you must use DATETIME, which uses local time. Pretty much all other databases have a timezone-compatible column type that stores UTC under the hood and converts to and from the connection timezone on the fly. This behavior perfectly matches Java’s date/time functionality and “just works” with Ignition.

If you’ve ever wondered why Ignition’s Tag Historian uses a long integer (UTC milliseconds) for `t_stamp` instead of a proper timestamp column, now you know.

So:

- Use a timezone compatible column type in a competent DB (like `timestamptz` in PostgreSQL), or
- Run your MS SQL Server and your Ignition gateway in UTC–Java will do the rest.

---

_[View the full topic](https://forum.inductiveautomation.com/t/ignition-min-and-max-date-from-dataset/18499)._
