Ignition Min and Max Date From Dataset

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.