Troubleshooting
Historian shows a real value hours off: check the UTC offset
Short answer
A historian value that is real in the raw data but displayed hours late is a timestamp-basis mismatch: the store keeps UTC and the client reads it as local time. Confirm the record exists, convert it with the offset in force on the event date, and correct the conversion layer — never edit the stored history.
On this page
- Why does my historian show a real value hours after it happened?
- How do I confirm the record exists in raw history?
- Which clock is wrong: the writer, the database or the display?
- How do I convert the stored timestamp with the right offset?
- How do I fix it without editing the stored history?
- When is the extreme value itself the fault?
- What is the decision for each outcome?
- Questions asked
An extreme value on a historian trend that turns up in the raw data several hours away from where the chart draws it is not bad data. It is a timestamp-basis mismatch: the history store keeps UTC and the client renders the stored clock reading as plant local time, so every point sits a fixed number of hours late. Confirm the record exists, convert the stored reading with the UTC offset in force on that event's date, and fix the conversion at the layer that displays or exports the timestamp — never by editing stored rows. This page gives the checks in order, a worked conversion with the arithmetic shown, and the decision for each outcome.
Why does my historian show a real value hours after it happened? #
The value is almost always genuine: the historian stored its timestamp in UTC and the display renders the stored clock reading as plant local time, so every point sits a fixed number of hours late — five hours on a US Central summer plant, for example.
Three signatures confirm it. The displacement equals one zone offset, typically whole hours. The magnitude matches the stored record exactly once display formatting is stripped. And every tag served by the same store shifts by the same amount, because they share one timestamp basis. A single tag drawn hours off while its neighbors sit correctly points at that tag's writer clock instead, which is a different repair.
How do I confirm the record exists in raw history? #
Query the raw, unaggregated history for a narrow window around the stored clock reading and match tag, value and quality; if the exact magnitude appears once, the data is good and the fault is in the way the client converts the timestamp.
Work it in this order:
- Read the trend binding and confirm which tag path it resolves at runtime — a script-built tag-path reference can point at a neighboring tag while looking right in the editor.
- Compare the chart's number with the same cell of the returned dataset, formatting off; grouping separators change presentation, never magnitude.
- Query raw history over a window as wide as the suspected offset plus a margin, pulling tag, timestamp, value and quality.
- Note the stored reading of the matching record and carry it into the offset check below.
This step separates a binding fault from a data fault: a chart bound to the wrong column shows valid data that was never requested, while a confirmed record proves the write path and leaves time conversion as the only suspect.
Which clock is wrong: the writer, the database or the display? #
In this fault none of the clocks is wrong: the writer stamped the record in UTC, the database stored it faithfully, and only the display layer assumes the reading is local, so hunt for the conversion rather than a server clock to adjust.
Changing the server's timezone or its clock does not reinterpret stored rows; it only changes how new stamps are generated. What decides the meaning is the store's documented convention. An offset-bearing type such as SQL Server's datetimeoffset carries its basis inside each value, while a plain datetime column carries an agreed basis that the historian's documentation states and every reader must honor. Three places have to agree on that basis: the writer's stamping, the query boundary times, and the client's rendering. A start or end argument supplied in the wrong basis returns a window that looks empty or shifted and sends the diagnosis the wrong way.
The same UTC-versus-local split appears on its own in other layers: a controller whose wall clock was uploaded from an engineering station can stamp its own records hours off, which is the separate fix described in the guide to a controller wall clock running hours off.
How do I convert the stored timestamp with the right offset? #
Offset equals local clock time minus the stored UTC reading for that instant, and it changes with daylight saving: US Central runs UTC-5 from March to November and UTC-6 in winter, while Central Europe runs UTC+2 in summer and UTC+1 in winter.
Say the historian keeps UTC in a plain datetime column, a motor trip draws on the trend at 19:51:40, and the shift log puts the trip at 14:51:40 plant time. One record explains both numbers:
- Stored reading: 2024-07-15 19:51:40, UTC basis
- Plant zone on that date: US Central daylight time, UTC-5
- Local instant: 19:51:40 - 05:00:00 = 14:51:40 on 2024-07-15
The record and the trip are the same instant; the trend drew the stored clock reading as if it were local, so the point sits 5 hours late. Repeat the arithmetic on a winter record with the same stored reading: 2025-01-15 19:51:40 - 06:00:00 = 13:51:40 Central standard time, and a hard-coded minus-five conversion would label it 14:51:40, one hour wrong. UTC has no seasons and civil time does, so every record converts with the offset in force on its own date.
How do I fix it without editing the stored history? #
Correct the layer that renders or exports the timestamp — the client's timezone setting, the query that formats results, or the read path that interprets the column — and leave the stored rows alone; rewriting timestamps in place breaks continuity for every other consumer of that history.
Start with the client's timezone setting, then the query, then the read path. Render trend labels in plant local time and keep exports and logs in UTC, so one instant reads the same on every screen while files keep a single basis. On SQL Server, the documented pattern is to convert at read: AT TIME ZONE attaches the UTC basis to a naive column and converts it to the plant zone inside the same SELECT, so no stored row changes, and new writes can move to datetimeoffset so the offset travels with each value.
Apply the conversion exactly once; a double conversion moves the point again by the same offset. If this history feeds alarms, batch records or compliance reporting, make the change as a documented change with before-and-after evidence for one known tag, value and timestamp. The same hour arithmetic applies when you verify an export by hand, which is what the guide to converting historian CSV timestamps in Excel walks through.
When is the extreme value itself the fault? #
Treat the magnitude as a separate fault once time alignment matches: re-query the aligned instant as raw data, and if the extreme number is genuinely stored there, trace it upstream to the endpoint or a second writer instead of the chart.
Three candidates survive the time check. An aggregate can: a sum legitimately exceeds every sample and an average or interpolated result lands on its own timestamp, so the raw re-query comes before any judgment. A second writer can: a restored project instance writing to the same database with a different time convention produces records that look hours off even with a correct client, so inventory every writer and its destination first. The endpoint can: a scaling fault or a bad read on a legacy device records a real extreme, and only a live recurrence with synchronized clocks will show it.
A distinct time fault — backdated values stamped with the receiving time instead of their true origin — is covered in the article on a historian showing current time for backdated PLC data.
What is the decision for each outcome? #
Commit per outcome: the value appears once in raw history and its stored reading plus the date's offset equals the true event time, so fix the display conversion; raw history lacks the value at any offset, so treat it as a binding or write-path fault.
| Raw-history evidence | Meaning | Decision |
|---|---|---|
| Magnitude present once; stored reading plus the date's offset equals the shift-log time | Timestamp-basis mismatch | Fix the client or query conversion and close the case |
| Magnitude only under an aggregate query | Aggregate or binding fault | Re-query raw and check the binding's aggregation mode before touching the writer |
| Magnitude absent at every offset you try | Write-path fault | Inventory writers and destinations, then watch the endpoint during a live recurrence |
A trend that draws every record at its stored reading plus that record's date offset, and an export that stays in UTC, ends this class of fault rather than one occurrence of it.
Questions asked
Does a whole-hour shift always mean a timezone problem?
Mostly, but the offset need not be a whole hour: India runs UTC+5:30, parts of Australia UTC+9:30 and Nepal UTC+5:45, so a five-and-a-half-hour displacement is the same fault with a partial offset. A 12-hour flip usually means AM or PM parsing rather than a zone.
Will changing the server's timezone setting correct the old records?
No. The timezone setting shapes how new timestamps are generated, not what stored readings mean: a row written as UTC stays UTC after the change. Fix the display or query conversion instead, and expect the setting change to also affect job schedules and log naming on that server.
What should the historian store so this cannot recur?
An offset-bearing type such as SQL Server's datetimeoffset keeps each writer's offset with the value, so any reader can convert correctly on any date. A plain UTC column also works if every reader treats it as UTC and converts once on display. The failure mode is mixed bases, not either choice.
Why does one export show a huge plain number instead of a time?
That number is usually a Unix epoch timestamp, not a process magnitude: seconds since 1 January 1970 UTC, or milliseconds in many systems. A 10-digit value reads as seconds and a 13-digit value as milliseconds. Convert it with your reporting tool before treating it as an extreme process value.