You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is caused by a combination of two non-intuitive behaviors of DateTime::createFromFormat:
Missing fields are initialized with the current date/time
Out of range values trigger overflow behavior to produce a valid date
This means that DateTime::createFromFormat('Ym', '202302') will use the current day of the month, e.g. the parsed date will be 2023-02-31 on January 31st. The overflow behavior "corrects" this to 2023-03-03.
Prefixing the format string with "!" will set missing fields to sensible, fixed default values (i.e. 1 for the day).
This is probably an issue with PHP, not with the library itself. I can't wrap my head around it:
I will create a commit to let the test pass for now, and I will get back to it whenever I can.
Another similar issue: https://github.com/henriquemoody/Validation/actions/runs/8103265516/job/22147529888
The text was updated successfully, but these errors were encountered: