Skip to content

DTM Decoder

  • Container free time, demurrage, billing deadlines, bill of lading dates and EDI timestamps.

Paste a UN/EDIFACT DTM segment, or type a value and its format code (data element 2379). The tool takes the value apart field by field, says what it states, and reads an offsetless value in the zones you choose. A value means nothing without its code, and most codes carry no offset. The tool calls classifyEdifactDtmFormat on the code, then the parser of the kind that came back, and everything on the page is what those calls returned.

1. Paste a segment or a value

A local time at a place the value does not name. The strip reads it in four example zones; none is the answer until you know where the sender's clock was. Change them.

2. What the value states

Kind
no result
Value
no result
Period end
no result
Instant
no result
Offset
no result
 

3. Where an offsetless value lands

1
2
3
4

4. Written back by the matching formatter

 

How a segment is split. The tool splits a segment with the UN/EDIFACT default service characters and reads the three components of the DTM composite. The function qualifier is shown as sent and never interpreted. A custom UNA service string is not read. Only a segment is un-released: a bare value reaches the library as typed, so a ? left in it is refused, and the reason says so.

The two verdicts. The offset is stated, as with 205, 208 or a 303 value ending in +02, UTC or GMT: the tool shows the instant. Or the offset is not stated, as with 203, a date, a time or a period: the tool shows where the value lands in the zones you pick. A value or a code the library does not read shows NO SIGNAL with one sentence saying why. A CET under 303 is that, because the field holds a signed hour, UTC or GMT. A two-digit-year code is that too, and the sentence points at the pattern parsers with a yearWindow.

Why the zones are yours. The library maps no place to a zone, so the four zones are your picks. The 203 and CET presets open with four example zones, and the value does not say any of them. Each row calls resolveLocal with disambiguation: "reject": a time the clock shows twice, or never, is not resolved, and the row says why.

The functions. There is one parser, one formatter and one validator for each kind of value: parseEdifactDateTime and parseEdifactOffsetDateTime are two of the six. The matching formatter writes the value back, isValidEdifactDtmFormat tells an unknown code from a bad value, and resolveLocal turns a local time into an instant in a zone you name. The rules are in Intermodal: EDI Timestamps.

Worth trying: a CET value — the result is NO SIGNAL, and the sentence says the 303 field holds a signed hour, UTC or GMT. Replace CET with UTC and the value states its offset. Then a two-digit year — the result is NO SIGNAL: no EDI function reads a two-digit year, and the sentence names the pattern parser and the yearWindow that read it. For a value that returns a result, try a period of local date-times: each end lands in the zones you chose.