Skip to content

HL7 Timestamp Reader

  • Timestamps in HL7 and FHIR clinical data: a precision set by what is sent, and a time with no offset, which HL7 reads as local time and FHIR refuses.

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 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 writes back at each precision.

1. Type an HL7 date-time

A DTM with no offset. HL7 says it is the sender's local time, so it names no instant until you know the sender's zone. The zones are the example's picks, never something the value says: change them.

2. What the value states

Type a value to take it apart.

What the parser returned, member by member
MemberValue
Kindno result
Instantno result
Offsetno result
Localno result
Precisionno result
nothing to read

3. Where a value with no offset lands

The same local time in up to four zones
RowZoneInstantOffsetRead as UTC
1   
2   
3   
4   

no zone chosen

4. Written back by formatHL7

The value written at each precision
PrecisionAs sentWith offset
year  
month  
day  
hour  
minute  
second  
fraction  

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 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 reads, formatHL7 writes and isValidHL7 tells a bad value from a good one. The rules are in Healthcare: Clinical Timestamps. For a FHIR R4 date, dateTime or instant, see the FHIR Date Checker.

Worth trying: a month sent as a time stamp — the value is a partial one, and no instant appears. Then a time that falls in the hour the clocks go back: the clock shows it twice, so the zones that observe the change refuse it.

© 2026 NorthGuild · Licences

Code examples: MIT-0. Packages: MIT. Third-party data and components: their own licences, credited where they appear. Everything else: © 2026 NorthGuild, all rights reserved.