Skip to content

Field notes

Apple Health Export Time Zone: The Offset Belongs to the Export, Not the Entry

The offset at the end of each timestamp in export.xml is the phone's offset on the day you exported, not where you were when the entry was made. Parse to the instant first.

datareference
The Optimized Team· ProductUpdated Nov 19, 2026

The offset in an Apple Health export is the export's, not the entry's#

Each timestamp in an Apple Health export.xml ends in an offset such as -0500, which makes it look as if every entry remembers where you were. It doesn't. The offset is the one your phone used on the day you ran the export, and it is the same on every line. Read it as a way to recover the exact instant, never as the zone you were in when the entry was made. Below: what the offset is, how to parse it, where a real per-entry zone does exist, and how to keep local time right when you travel.

What the offset in export.xml actually is#

Same offset on every line#

A timestamp in the export looks like 2019-04-10 08:10:34 -0500. One analyst who worked through their own export reported that every timestamp in the dataset had the same offset, which was simply their local offset at the time the export was done. The same author concluded that the exported data has no information about time zone or daylight saving. The timestamp is best treated as an absolute moment, and the clock text is only that moment written in the export's zone.

Same record, two exports#

Because the offset is stamped on at export time, the same record can read differently depending on when you export. In that analyst's case, an export made during Eastern daylight time showed -0400 on every line, while one made in standard time showed -0500. Their example was a walk in England. One export wrote 2019-09-01 05:51:58 -0400 and the other wrote 2019-09-01 04:51:58 -0500. Both are 09:51:58 UTC, and the watch itself had shown British Summer Time.

| What you see in the file | What it is | |---|---| | The clock text (05:51:58) | The instant written in the export's zone | | The offset (-0400) | The phone's offset on export day | | The instant (09:51:58 UTC) | The only part that belongs to the entry |

Parse to the instant first#

The safe order is instant first, zone second. Parse the start and end of each entry with its offset into an absolute time, store that, and decide the local zone as a separate step.

2019-09-01 05:51:58 -0400  ->  2019-09-01T09:51:58Z
2019-09-01 04:51:58 -0500  ->  2019-09-01T09:51:58Z

The usual mistake is cutting the offset off and keep the clock text as if it were local time. Do that with an export made in daylight time and every winter entry is an hour off. Compare two exports and the same walk lands on two different hours.

Each record has a start and an end, and each is parsed on its own. If you want the reasoning behind that, see why a log entry is a span, not a moment.

Where a real time zone exists#

Apple does have a place for a per-entry zone. HealthKit defines HKMetadataKeyTimeZone, described in Apple's developer documentation as the time zone the user was in when the object was created. The catch is how rarely it is filled in. A discussion from the Open Wearables project tested a sync and reported:

  • Regular records such as steps and heart rate: the key was never present.
  • Sleep records from Apple Watch: present about 100% of the time, with only manually added sleep records missing it. Two of 2,026 sleep records lacked a zone, both added by hand.
  • Workouts: partial. Five of 19 had a zone, all recorded on Apple Watch.

An Apple Developer Forums thread from 2018 shows the same gap from the app side: a developer reading step samples found the key empty and had to fall back to the device's current zone. No Apple reply appears in that thread, and the behavior may have changed since, so check your own data before relying on either account.

The Open Wearables team chose not to fall back to the current device zone, because that would present false history for anyone who was elsewhere when the data was recorded. That's the right instinct for a personal record too. If two devices wrote overlapping entries, the zone question stacks on top of the problem described in when two devices do not match.

Assigning local time when you travel#

If you only ever live in one zone, one rule is enough: convert every instant to that zone using a zone database, not the fixed offset from the file. A zone database knows the daylight saving changes for each date, while the fixed offset from the file only describes export day.

If you travel, you need a record of where you were. Keep a small table of date ranges and zones, then join each entry's instant against it. The analyst quoted above did exactly this, assigning a zone to every row from a travel history. Scheduled flight times may not match real arrivals, so keep the table to days you can vouch for.

Sleep entries with a zone can serve as a cross-check on that table. Whether they can be used to infer zones for other records from the same period is, per the Open Wearables discussion, still an open question, so read a mismatch as a flag to look at, not a correction to apply.

Why day totals move#

Daily totals depend on where the day is cut. If an importer drops the offset and slices days at UTC midnight, counts shift into the wrong day for anyone far from UTC. One open issue in the Open Wearables project describes exactly that: because the XML import did not keep the offset, daily summaries split at UTC midnight.

The fix is the same two-step order. Keep the instant, pick the local zone, then cut the day. The same care applies in lab logs, where collection date and report date answer different questions and you have to choose one on purpose.

What to record#

  • Keep the instant in UTC for every entry, parsed from the offset in the file.
  • Note the date you ran the export. It tells you which offset is stamped on the text.
  • Store a local zone as its own column, and mark whether it came from the entry, from your travel table, or from a default.
  • Never overwrite the zone with the phone's current one without saying so.

The time zone is one of several quiet traps in an export. Another is units that look alike but never convert, covered in count and percent in Apple Health.

Share

X / Twitter