Skip to content

FHIR Date Checker

  • 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 a FHIR R4 value. FHIR is published by HL7 International, and it has three primitive types that carry a date: date, dateTime and instant. The tool calls parseFHIR and isValidFHIR and shows which of the three types the value fits, and what it names: a year, a month, a day or an instant. The last section shows what formatFHIR writes back.

1. Type a FHIR value

A month. FHIR keeps it as a month, and a parser that pads it to the 1st invents a moment the sender never sent.

2. What each type says

Each FHIR type, checked
TypeValidFHIR patternWhy
dateno resultno result
dateTimeno resultno result
instantno resultno result
What the parser returned, member by member
MemberValue
Value
no result
Precision
no result
Offset
no result
nothing to read

3. What the value names

4. Written back by formatFHIR

The value written back, at each precision
PrecisiondatedateTimeinstant
Default (no precision)   
year   
month   
day   
second   
fraction   

How a value is read. parseFHIR keeps the precision that was sent. A year, a month or a day is a partial value with no instant, and the tool never pads it. A time to the second or finer with an offset is an instant. A dateTime with a time must also carry an offset or Z. Without one it is not a FHIR value, and the tool reads it neither as a local time nor as UTC.

Why a pattern match is shape only. HL7 International publishes one regular expression for each type, and the specification calls them “informative, not normative”. A value can match its pattern and still not be a date, such as 2024-02-30. The tool shows the pattern result and the library result side by side, and the “Why” line says what the pattern cannot catch.

What the writer refuses. formatFHIR writes a type only when the moment fits it, and the cell says “no result” when it does not. FHIR has no minute precision, so a time to the minute is not written. It has no leap second, so :60 is refused. It never fills in what was not sent: a date has no time to give an instant, and the writer will not make one up. An offset of -00:00 is kept as sent.

The functions. parseFHIR reads, formatFHIR writes and isValidFHIR tells a bad value from a good one. The rules are in Healthcare: Clinical Timestamps. For an HL7 v2 value, use the HL7 Timestamp Reader.

Worth trying: a date that is not on the calendar, which matches its pattern and is still refused. Then a time to the minute: ISO 8601 allows it, and FHIR does not.

© 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.