HL7 Timestamp Converter (DTM)

Convert between Human Readable dates and HL7 Timestamps (DTM).

Save

Inputs

Your values stay on this device.

Results

Converted Timestamp

Report

Export and share

Document

Copy and share

Assumptions

  • Generation uses the browser's local date and time inputs and outputs through whole seconds only.
  • Parsing focuses on the leading date and time digits and does not fully interpret fractional seconds or timezone offsets.
  • This tool is meant for quick format conversion, not implementation-guide validation for every TS or DTM precision rule.

Sensitivity preview

No numeric sensitivity scenarios are available.

Related Tools

View All

About this DateTime Converter

HL7 timestamps are compact and often appear in fields like MSH-7, EVN-2, or OBR-7. This converter helps you quickly build a basic timestamp string for test data or decode a received value into something easier to read during troubleshooting.

Who this calculator is for

  • Interface analysts decoding timestamps in HL7 headers, orders, and result messages.
  • Developers building sample messages that need a compact DTM-style date/time value.
  • Anyone checking whether a test message timestamp was formed the way they expected.

When to use it

  • Use it when building sample HL7 messages for interface testing.
  • Use it when a raw timestamp in MSH, EVN, ORC, OBR, or OBX needs quick human interpretation.
  • Use it to confirm the basic year-month-day-hour-minute-second ordering of an HL7-style date/time string.

How to use this calculator

  1. Select Generate HL7 to convert a standard Date/Time into the HL7 DTM format.
  2. Select Parse HL7 to convert a raw HL7 timestamp string back into a readable date.
  3. The result updates instantly.

Key assumptions

  • Generation uses the browser's local date and time inputs and outputs through whole seconds only.
  • Parsing focuses on the leading date and time digits and does not fully interpret fractional seconds or timezone offsets.
  • This tool is meant for quick format conversion, not implementation-guide validation for every TS or DTM precision rule.

Accuracy and testing

Review formula sources, default test cases, assumptions, unit handling, rounding rules, and changelog for this calculator.

View accuracy page

How this calculator works

Format: `YYYYMMDDHHMMSS` * YYYY: 4-digit Year * MM: 2-digit Month * DD: 2-digit Day * HH: 2-digit Hour (24-hour clock) * MM: 2-digit Minute * SS: 2-digit Second (Optional)

Inputs explained

Date/Time

Standard calendar inputs for generation.

HL7 Timestamp

The compact string found in HL7 fields like MSH-7 or OBR-7.

Understanding your results

The generator creates a 14-character string (up to seconds). The parser outputs a standard readable format (YYYY-MM-DD at HH:MM:SS).

Example scenarios

Basic Date

2023-12-25 -> 20231225

Full Timestamp

2023-12-25 14:30:00 -> 20231225143000

Key Features

  • Bidirectional Conversion
  • Standard Format Support
  • Instant Parsing

Tips & Best Practices

  • HL7 timestamps are often precise to the millisecond (e.g. `...143000.1234`).
  • Time zones can be appended as offsets (e.g. `-0500`), though this tool generates local time without offset for simplicity.

Glossary of Terms

DTM
The HL7 v2 Data Type for Date/Time.
Precision
HL7 allows partial dates. `202310` is a valid timestamp representing October 2023.

Frequently Asked Questions

What is the format?
YYYYMMDDHHMMSS. The seconds and timezone are optional but recommended.
What does the Z mean?
Standard HL7 allows an offset (e.g. -0500) but often local time is used without offset. This tool generates local time.
Can I handle milliseconds?
Yes, up to 4 decimal places for seconds are allowed in HL7 v2.x.
Is this Y2K safe?
Yes, HL7 requires 4-digit years.
What data type is this?
This corresponds to the TS (Timestamp) or DTM (Date/Time) data type.