-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed as not planned
Description
Description
Run the following code on the 31 day of the current month (ex. october):
$dt = \DateTime::createFromFormat('Y-n','2024-11'); echo date("t", $dt->getTimestamp());
Resulted in this output:
31
But I expected this output instead:
30
Workaround:
$dt = \DateTime::createFromFormat('Y-n-d','2024-11-01'); echo date("t", $dt->getTimestamp());
PHP Version
PHP 8
Operating System
Ubuntu 20