Function assertValidDateTimeFormat
Parameters
- format: string
The date format string to validate.
Optional
options: DateTimeOptionsOptional formatting and parsing options for date-time operations.
Returns void
- format: string
The date format string to validate.
Optional
options: DateTimeOptionsOptional formatting and parsing options for date-time operations.
Asserts that the provided date format yields consistent results when formatting and parsing a date.
This function formats a fixed UTC reference date into a string using the given format and optional options, then parses that string back into a date. It verifies that the parsed date is valid and that reformatting it produces the original string. Failing this consistency check triggers an error, indicating that the format is invalid for round-trip date conversions.