I have a year (2002), and I'm trying to make it in the following format:
2002-00-00T00: 00: 00
I tried various iterations, the last of which was the following:
$testdate = DateTime::createFromFormat(DateTime::ISO8601, date("c"))
echo date_format($testdate, '2002');
But, even if I get closer, it always seems that he adds +00: 00 to the end ...
source
share