# HL7 Timestamp Reader

Industry: Healthcare

**Key point — HL7 v2 date-times (DTM and TS)**

An HL7 time with no offset is the sender's local time. It is not UTC.

Type an HL7 v2 date-time, the `DTM` of a field or the older `TS` with its precision code. HL7 v2 is published by HL7 International. The tool calls [`parseHL7`](/gmt/reference/healthcare/parse/parseHL7/) and shows what the value states: how many digits it carries, whether it has an offset, and whether it is a time at all. A value with no offset is read in the zones you choose, and the last section shows what [`formatHL7`](/gmt/reference/healthcare/format/formatHL7/) writes back at each precision.

**How a value is read.** The tool reads one field. No `MSH-2` is read, so `^` separates the components and `&` the subcomponents, as HL7 recommends, and a message with other separators is not read as a message. A third component and anything after it is shown as ignored and not read, because HL7 tells a receiver to ignore what it does not expect, unless it holds a `|`, a `~` or a control character, which end the field. A `&` inside the date-time or the degree is refused: GMT reads each of those as exactly one value. A value that is not a date-time shows `NO SIGNAL` with one sentence saying why.

**The four kinds.** A value to the minute or finer, with an offset, is an instant. The same with no offset is a local time. A year, a month, a day or an hour is a partial value, with or without an offset, and so is a finer value that a `TS` degree of precision cuts to one of those. A partial value has a precision and no instant, and the tool never pads it. The null value, two quote characters, is its own kind. It clears a stored time, and it is not a missing field.

**Why the zones are yours.** The library maps no facility to a zone, so the four zones are your picks. The presets open with example zones, and the value does not say any of them. Each row calls [`resolveLocal`](/gmt/reference/instant/convert/resolveLocal/) with `disambiguation: "reject"`: a time the clock shows twice, or never, is not resolved, and the row says why. The strip also sets each result against the same digits read as UTC, which is the mistake the page is about.

**What is written back.** The last section calls `formatHL7` once for each precision, from year to fraction, on the same moment. It cuts to the precision asked for and never rounds. A precision finer than the value carries is not made up.

**The functions.** [`parseHL7`](/gmt/reference/healthcare/parse/parseHL7/) reads, [`formatHL7`](/gmt/reference/healthcare/format/formatHL7/) writes and [`isValidHL7`](/gmt/reference/healthcare/validate/isValidHL7/) tells a bad value from a good one. The rules are in [Healthcare: Clinical Timestamps](/gmt/guides/industries/healthcare-clinical-timestamps/). For a FHIR R4 `date`, `dateTime` or `instant`, see the [FHIR Date Checker](/gmt/tools/fhir-date-checker/).

**Worth trying:** [a month sent as a time stamp](/gmt/tools/hl7-timestamp-reader/?w=hl7&wa=%7B%22preset%22%3A%22ts-month%22%7D) —
the value is a partial one, and no instant appears. Then [a time that falls in the hour the clocks go back](/gmt/tools/hl7-timestamp-reader/?w=hl7&wa=%7B%22preset%22%3A%22fall-back%22%7D): the clock shows it twice, so the zones that observe the change refuse it.
