Adds a strict mode which validates that the date string can be turned into the expected date.
eg 2022-13-05 passes the date format Y-m-d but creates the date 2023-01-05
Strict mode confirms that the date not only matches the format but comes out the same when formatted that way from the date time object. This check will fail if PHP's datetime object changes the date value from what was passed in order to turn it into a valid date.
This behaviour cannot be the default as some date format strings eg Y-m-d| do not produce the same result when used in \DateTime->format() calls.
Adds a strict mode which validates that the date string can be turned into the expected date.
eg 2022-13-05 passes the date format Y-m-d but creates the date 2023-01-05
Strict mode confirms that the date not only matches the format but comes out the same when formatted that way from the date time object. This check will fail if PHP's datetime object changes the date value from what was passed in order to turn it into a valid date.
This behaviour cannot be the default as some date format strings eg Y-m-d| do not produce the same result when used in \DateTime->format() calls.