DTP02 in X12 834: A Field Guide to Date Time Period Format Qualifier
DTP03 is just a string of digits until DTP02 tells the parser how to read it.
DTP02 states the format that the date value in DTP03 is written in. On an 834 coverage-begins or coverage-ends occurrence this is almost always a single calendar date, but the field exists precisely because DTP is reused across many contexts where a different shape of value might show up, so a parser should read DTP02 rather than assume.
Common values you'll see in practice
Example
A synthetic DTP where DTP02=D8 tells the parser that DTP03 is one eight-digit date rather than a range, so 20260901 should be read as September 1, 2026.
Where this trips people up
Because D8 covers the overwhelming majority of real-world 834 coverage dates, it's common for a parser to be built with the date format hardcoded and DTP02 never actually checked. That works fine until a trading partner sends an RD8 range on some other DTP occurrence in the same file, or a malformed file has the wrong qualifier in this position, and the hardcoded parser either throws an unhandled error or, worse, silently truncates the value. Include at least one RD8 case and one deliberately mismatched DTP02/DTP03 pair in your test data so the parser's format handling actually gets exercised.