Reference·MSH Segment·MSH-7
HL7 v2 Reference

HL7 v2 MSH-7 (Date/Time of Message): Format, Values, and Testing Notes

Jul 27, 2026 · 4 min read
← MSH-6 MSH-9 →

MSH-7 looks like a simple timestamp, but source systems vary in both the precision they send and whether they include a timezone offset at all — and any logic that orders or de-duplicates messages by this field inherits every one of those inconsistencies.

Quick answer

MSH-7 is the seventh field of the MSH segment — a timestamp recording when the sending system created the message, in YYYYMMDDHHMMSS format with an optional timezone offset.

What this field contains

YYYYMMDDHHMMSS
Full precision down to the second — the most common format in modern feeds
YYYYMMDDHHMM
Minute-level precision, still common with older source systems
+/-ZZZZ
Optional timezone offset appended after the timestamp

Example

Synthetic example Generated by Synthibase
MSH|^~\&|ADTSYS|HOSP|BILLSYS|HOSP|20260727143000||ADT^A01|MSG00001458|P|2.5.1

The 7th field, 20260727143000, records the message as created on July 27, 2026 at 2:30:00 PM. Synthetic message — not a real transmission.

Where this trips people up

Interfaces that compare MSH-7 across messages from different source systems to determine ordering or detect duplicates often assume every feed reports in the same timezone with the same precision — an assumption that holds fine within a single system and breaks the moment a second source system, running on a different clock convention, gets connected to the same interface engine.

HL7 v2 MSH Explained: Structure, Fields, and Common Mistakes
How to Write EDI Test Cases That Actually Catch Go-Live Failures
How to Build a Test Environment Strategy for a Multi-Hospital System
Test timestamp and timezone drift before go-live
Synthibase generates synthetic MSH headers with varied timestamp precision and timezone offsets, so ordering bugs surface in testing, not production.
Start free trial →
This page is written independently by Synthibase for testing and informational purposes. It is not an official publication of HL7 International or X12/Washington Publishing Company, and is not a substitute for reviewing the official standard or your trading partner's companion guide. See our Terms of Service for full legal terms.