Skip to main content
Version: v0.0.4

Interface: DtmToDateOptions

Options controlling how dtmToDate resolves a missing timezone.

Example

import { parseDtm, dtmToDate } from "@cosyte/hl7";
// Treat an offset-less value as UTC (an explicit caller choice):
dtmToDate(parseDtm("20250102"), { assumeOffsetMinutes: 0 });
// ...or as US Eastern standard time (UTC-05:00):
dtmToDate(parseDtm("20250102"), { assumeOffsetMinutes: -300 });

Properties

assumeOffsetMinutes?

readonly optional assumeOffsetMinutes?: number

Offset (signed minutes east of UTC) to assume when the value carries no timezone. Without it, an offset-less value resolves to undefined, dtmToDate never guesses a zone. Ignored when the value already has an offset. Pass 0 to explicitly treat a naive value as UTC.