Issue
When a SQL query is run on taclogdata to view events or trend logs, the time stamps returned differ by an hour or more from the those of the same events when viewed in Vista.
Environment
TAC Vista 4.3 and higher
MS SQL Server
Cause
All time stamps are stored in taclogdata as UTC (Universal Coordinated Time) regardless of your local time zone and DST (Daylight Saving Time) settings. When you view events or trend logs in Vista, the Time Zone and DST settings of your Workstation are added to the UTC time so that you see time stamps synchronized with your local time.
This does not occur when a SQL query is run directly on taclogdata.
Resolution
If you need to query the Vista SQL database directly, you could use the DATEADD function to calculate your local time from the UTC values, e.g. in SQL Server Management Studio run the following query to show the EventId, UTC time and local time for all events that occurred in the last 24 hours.
USE taclogdata;
SELECT EventId, EventDatetime, DATEADD(hour, datediff(hour, getutcdate(), getdate()), EventDatetime) AS LocalTime
FROM Event
WHERE EventDatetime > DATEADD(day, -1, GETUTCDATE())
Please note: DATEADD adds a fixed offset to the input time. It does not compensate for start and end dates of DST.