# Perspective Table shows incorrect datetime from a Named query

**URL:** <https://forum.inductiveautomation.com/t/perspective-table-shows-incorrect-datetime-from-a-named-query/49428>\
**Category:** Ignition\
**Tags:** perspective, database\
**Created:** [July 31, 2021, 10:44pm UTC](https://forum.inductiveautomation.com/t/perspective-table-shows-incorrect-datetime-from-a-named-query/49428 "2021-07-31T22:44:11Z")\
**Posts on this page:** 1\
**Showing post:** 10

<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 30, 2021, 1:08am UTC](https://forum.inductiveautomation.com/t/perspective-table-shows-incorrect-datetime-from-a-named-query/49428/10 "2021-11-30T01:08:53Z")

</div>

If you are stuck with MS SQL Server, you should know that it doesn't play well with Java and time zones. More info:

> [@Ignition Min and Max Date From Dataset](https://forum.inductiveautomation.com/t/ignition-min-and-max-date-from-dataset/18499/7):
>
> 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…

> [@SQL Server store datetime object with time zone](https://forum.inductiveautomation.com/t/sql-server-store-datetime-object-with-time-zone/49319/2):
>
> Two suggestions: Don’t use jython’s datetime. Use java.util.Date and related types–that’s what Ignition passes around. Set MS SQL Server to use UTC and the server it runs on to UTC. That is the only way to have flawless date/time/timezone support in Ignition. Java’s datetime type is fundamentally built in milliseconds UTC (including serialization when passed over a network) with conversions to and from local time zones as needed. This allows clients and gateways to work with the same…

---

_[View the full topic](https://forum.inductiveautomation.com/t/perspective-table-shows-incorrect-datetime-from-a-named-query/49428)._
