Farbschema: Dunkel
Sie befinden sich hier: start » en » Documentation » Microsoft Access development tools » WKL Office JSON » WKL Office JSON troubleshooting » A date read from JSON is off by some hours

A date read from JSON is off by some hours

A timestamp such as "2026-09-25T12:30:00Z" arrives in VBA as 14:30, or a date written to JSON appears shifted in another system.

Environment

All versions of WKL Office JSON.

Cause

  • Reading: a time with a zone (Z for UTC, +02:00) is converted according to JDoc.DateZone. The default jdzLocal converts to the local time of Windows, so 12:30Z becomes 14:30 in Central European Summer Time. This is correct when the value is compared with Now(), but not when the database stores UTC.
  • Writing: a VBA Date has no zone and is written without one. A receiving system that assumes UTC reads a local time as UTC.

Resolution

  1. For databases that store UTC, set doc.DateZone = jdzUtc before reading.
  2. To keep times as written, set doc.DateZone = jdzAsWritten.
  3. Before writing to a system that expects UTC, convert the local time to UTC in VBA and append the zone to a string yourself, for example doc.SetValue "$.at", Format(utcTime, "yyyy-mm-dd\Thh:nn:ss") & "Z".

See Read and write dates and times.

en/wiki/msaccess/json/troubleshooting/date-shifted.txt · Zuletzt geändert: von Wolfgang van der Stille