Date and Time Segments (DTP) and Elements in X12 EDI

Looking for an EDI parser or converter? Try our API or command-line tool to convert your EDI files to JSON or CSV.

Any EDI transaction will include dates and, sometimes, times to define when events occurred. Dates and times are expressed using DTP segments.

Date

For example, a healthcare claim usually contains service dates, which are typically the date of the patient’s visit:

Another example:

To view your EDI files, go to our free EDI viewer or sign up for a free trial of the paid version. See the demo here.

Date and Time

Elements can include date and time together or just the time:

As before, the qualifier element (e.g., 472) determines the purpose of the date segment. The next element (DT, D8) defines the subtype of the date fields, i.e., date, date and time, date period. Just move your mouse over those fields to see these details.

Date Range

Unlike many other data formats (JSON, XML), an EDI element of type date could contain a date range, that is, “from” and “to” dates in a single field.

Dates Outside DTP

Date elements can be used as part of more complex segments, not just the DTP ones:

Don’t worry about all the other fields in the HI segment, this segment type will be covered elsewhere.