DTM: which date is which?
An EDI file contains several DTM lines and all of them carry dates. What tells you which is the document date and which is the delivery date is not the line itself but the qualifier inside it.
The structure
DTM+137:20260117:102'
There are three parts:
| Part | Value | Meaning |
|---|---|---|
| Qualifier | 137 | This is a document date |
| Value | 20260117 | 17 January 2026 |
| Format | 102 | In YYYYMMDD form |
Using a date without reading its qualifier is one of the most common mistakes in EDI.
Qualifiers you will meet
| Code | Meaning |
|---|---|
137 | Document / message date |
2 | Requested delivery date |
35 | Actual delivery date |
11 | Despatch date |
132 | Estimated arrival |
203 | Payment date |
263 | Invoicing period |
356 | Period start |
357 | Period end |
137 appears in almost every message; the others depend on the message type. An order carries 2 (requested delivery), a despatch advice 11 (despatch), a sales report 356/357 (the period).
Why the format code matters
The third part says how the date is written. The two most common:
| Code | Format | Example |
|---|---|---|
102 | YYYYMMDD | 20260117 |
203 | YYYYMMDDHHMM | 202601171430 |
Older files may also use 101 (YYMMDD). The two-digit year is a pre-2000 leftover and forces you to guess the century — avoid it where you can.
Code that ignores the format and guesses from the length works for a while, then breaks on the first file that carries a time.
The date in UNB is different
The date in the interchange header does not follow this pattern:
UNB+UNOC:3+A:14+B:14+260117:1030+REF00042'
Here 260117:1030 is in YYMMDD:HHMM form and has no qualifier — it is always the moment the interchange was sent. Trying to read the UNB date with DTM logic will not work.
The time zone question
EDIFACT dates carry no time zone by default. In which zone is 202601171430 14:30? The standard does not say; the specification does.
In practice there are two approaches: either both sides use local time and fix that in the agreement, or a separate time zone indicator travels alongside the DTM. In cross-border flows, skipping this distinction can shift delivery dates by a day.
When the same qualifier appears twice
That is valid, and the meaning depends on position. A DTM in the message header applies to the whole document; the same code after a LIN (line item) segment applies only to that item.
DTM+2:20260125:102' <- requested delivery for the whole order
LIN+1++5410013101234:EN'
DTM+2:20260130:102' <- for this line item only
The line-level date overrides the header for that item. Mappings that skip this rule produce wrong dates on partial deliveries.
Checklist
1. Read the qualifier; do not infer meaning from position 2. Use the format code; do not guess from the length 3. Treat the UNB date separately 4. Remember that a line-level DTM overrides the header
To see which date is which in a file, the quickest route is a viewer that decodes the qualifier when you select the line.