Closed j0k3r closed 5 years ago
Why not just make validateDate
return ?DateTime
?
@jtojnar because it'll break compatibility with current date return. Today we return a plain text which is a valid date according to parse_date
function. Now it'll return a formatted date instead but it'll still be a string.
DateTimeInterface
? Available since PHP 7.2 ? Looks odd.
Nope, it's only the constant that are moved to DateTimeInterface
in PHP 7.2, before they were defined in DateTime
:
7.2.0 | The class constants of DateTime are now defined on DateTimeInterface.
Instead of just validating the date is ok when parsing it, just convert it to the W3C format