skip to Main Content
368 views
0 votes

How can I safely parse the month using PHP?

Why does the following code return 12-2023? It should be 11-2023, right?
$datetime = DateTime::createFromFormat('m-y', '11-23');
echo $datetime->format('m-Y');

This

Back To Top
Search