Beforehand, I have read this question:
How to prevent PHP to convert a DateTime object with 0000-00-00 value to -0001-11-30
But I dont get why 0000-00-00 00:00:00 changes to -0001-11-30 00:00:00 when I run this code:
$date = date_create('0000-00-00 00:00:00');
echo date_format($date, 'Y-m-d H:i:s');
When I try it with 0001-00-00 00:00:00 I get:
0000-11-30 00:00:00
and with 0001-01-01 00:00:00 I get:
0001-01-01 00:00:00
and with 0000-00-01 00:00:00:
-0001-12-01 00:00:00
Is there any specific reason why it's always a year/day/month before the nonexisting date?
Is there something wrong with the functions date_create or date_format?
I do notice that the time is displayed the right way and that's probably because the time 00:00:00 exists.