My host updated from PHP 5.2 to PHP 5.3 and my date code no longer returns a year such as 2015 but instead a minus sign -1.
Wednesday November 30, 2015
has become
Wednesday November 30, -1
This is evidently because the command date
has changed. Despite trying out a lot of options, I can't get it to display properly
Here is my code that used to work and is now giving a -1 for the year.
function fulldatetime($datetime) {
$fullDate = strtotime($datetime);
$fullDate = date("l F jS, o, g:i A",$fullDate);
return $fullDate;
}
where $datetime is of the form: 2015-12-28 23:00:00
Can anyone explain to me the correct code to get the year to display right.
Thanks in advance for helping me to solve this vexing problem.