Date and time format 205

Error BR-FXEXT-CII-DT-097a Factur-X

Date time string with format attribute 205 shall be YYYYMMDDHHMMSS.

Mandatory rule: As long as it is violated, the invoice is invalid and will be rejected by validators.
What is wrong

The content of such a udt:DateTimeString element does not match the expected year, month, day, hour, minute, and second pattern in the order YYYYMMDDHHMMSS.

What the rule means

This format represents the date and time as a continuous string with a four-digit year and two digits each for the month, day, hour, minute, and second.

Please provide the date and time in the `YYYYMMDDHHMMSS` format

The content of udt:DateTimeString with format="205" does not match the expected date and time format. You can adjust the value to match this pattern.

What to do
  1. Check the content of udt:DateTimeString with format="205".
  2. Provide the year, month, day, hour, minute, and second in that order.
  3. Generate the invoice again and validate it once more.
What it looks like
✗ Triggers the message
<udt:DateTimeString format="205">20241315123045</udt:DateTimeString>
✓ Correct
<udt:DateTimeString format="205">20241115123045</udt:DateTimeString>
Technical details

The XPath checks the element text with a regular expression. Surrounding whitespace is allowed; the month, day, and time are checked against the numeric ranges specified by the pattern.

Where the rule applies

The rule applies to udt:DateTimeString elements with the attribute format="205".

Context (rule/@context)
//udt:DateTimeString[@format = '205']
Test expression (assert/@test)
matches(., '^\s*(\d{4})(1[0-2]|0[1-9])(3[01]|[12][0-9]|0[1-9])([01][0-9]|2[0-3])[0-5][0-9]\s*$')