Function assertValidDateTimeFormat

  • 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.

    Parameters

    • format: string

      The date format string to validate.

    • Optionaloptions: DateTimeOptions

      Optional formatting and parsing options for date-time operations.

    Returns void

    If the date format does not produce matching formatted strings upon parsing.