fhirDateTime
const fhirDateTime: RegExp = /^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?$/;RegExp matching a FHIR R4 dateTime: the regex of the dateTime StructureDefinition (https://hl7.org/fhir/R4/datetime.profile.json), verbatim and anchored.
Examples
Section titled “Examples”import { fhirDateTime } from "@northguild/gmt";fhirDateTime.test("2024-06") // truefhirDateTime.test("2015-02-07T13:28:17.239+02:00") // truefhirDateTime.test("2024-06-15T10:30:00") // false (a time needs a zone)fhirDateTime.test("2024-06-15T10:30Z") // false (seconds are required)fhirDateTime.test("2024-06-15T10:30:00+14:30") // false (offset past 14:00)Source
Section titled “Source”Accessibility
© 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.