InnerWeb
Skip to main content

Device and server time in logs: good practices for the IT analyst

An IT analyst comparing watch and server events quickly runs into a trap: some records are in UTC and some in local time, so a side-by-side comparison without conversion shows a 2-hour offset. We have collected practices that let you read the timeline correctly and measure silence after connectivity returns.

2 h
offset when comparing UTC with local time without conversion
Source: karta
78 s
upload period for log batches at a 26 s interval
Source: karta

Where the time mismatch comes from

The device log stores two times: the device time and the time of receipt by the server. The difference between them shows the length of silence after connectivity returns, so both are needed. The problem appears when these times, or other tables coming from the watch, are not stored in the same time zone.

The device time is sometimes in UTC, while some tables coming from the watch hold local time. Comparing them without conversion produces a 2-hour offset, depending on the season. The effect on the analysis is dangerous, because the offset looks like a real dependency: the device supposedly sent an entry two hours after the event.

Practice 1: always establish the time zone of each field before comparing

Before you compare two records, check in the documentation or in a data sample what time zone each time field uses. Do not assume that all tables from one system follow the same convention. Record the zone next to the field name in the analysis note: device_time: UTC, receipt_time: UTC, table X: local time.

A good test is an entry whose real time you know: for example, the moment of a test alarm. If the data show it 2 hours earlier or later, this is a sign that the field uses a different zone.

How to read the difference between receipt time and device time

How to read the difference between receipt time and device timeBar chart: a 1.3 minute difference is a normal upload, 14 minutes is an example of a connectivity gap, 120 minutes points to a time zone error.0255075100125minNormal upload (about 78 s): 1.3 min1.3 minNormal upload (about 78 s)Connectivity gap (example): 14 min14 minConnectivity gap (example)Time zone error: 120 min120 minTime zone error
Source: Example calculation: 78 s from the card, 14 min as an illustration of a gap, 120 min as the 2-hour offset

Practice 2: convert to one zone before the analysis

Convert everything to one zone, preferably UTC, at the start of the analysis, not in the middle of it. This way every following step works on uniform data. Add the local zone only at the stage of the report for the head of occupational safety, because that is the zone in which hours are entered in the protocol.

Be careful with the switch between summer and winter time: on the night of the change one hour occurs twice and another hour does not occur at all. Records from that night require particular care.

Practice 3: compare device time with receipt time to measure silence

The difference between the receipt time and the device time for the same entry shows how long the entry waited in the queue on the device. For entries sent in real time, the difference is a few dozen seconds, because the log is sent in batches every third heartbeat cycle, that is about 78 s with a 26 s interval. A difference of a dozen or so minutes indicates a connectivity gap.

If the difference is exactly about 2 hours, first suspect the time zone, and only then a connectivity gap. This simple rule saves hours of analysis.

  • Difference up to about 78 s: normal batch upload window.
  • Difference of minutes: connectivity gap, to be confirmed on the event timeline.
  • Difference close to 2 hours: check the time zone of the field first.

Practice 4: check the application version from one source

The time mismatch is not the only mismatch in logs. The application version is sometimes recorded in several places and can diverge. The version from the package manifest reported by the device management system is treated as the truth. When you analyze the behavior of a watch, establish the version from that source, because the behavior of times and formats may depend on the version.

Practice 5: describe the time convention in the deployment documentation

The best practice is one that does not have to be rediscovered. In the deployment documentation, record a table of time fields: name, zone, source. Update it with every schema change. A new analyst or an external auditor saves days of work this way.

Also introduce a rule for new tables: times are stored in UTC, and conversion to the local zone is done only when presenting.

Checklist

Video

Frequently asked questions

Why do the watch and server times differ by 2 hours?

Most often because the device time is in UTC while some tables from the watch hold local time. Without conversion, a 2-hour offset appears.

Which zone should times be converted to?

To one zone for the duration of the analysis, preferably UTC. Add the local zone in the report for the people who enter the hours in the protocol.

How do you tell a connectivity gap from a time zone error?

A difference of minutes suggests a gap, and a difference close to 2 hours suggests a zone error. Confirm it on an entry with a known time.

Do you analyze device logs?

We will show in a demonstration how to read the watch log and the server receipt time, so that the incident timeline is correct.

Let's talk