I have some legacy code that was working for quite some time as follows:
$eventdate2 = new DateTime($eventdate);
However, my host changed the version of PHP I am using and since then it has not worked i.e. the code breaks at this point.
Unfortunately, I can't say what the old version of PHP was. The host said they changed it back to the old version after I encountered a lot of other problems. All I can say for sure is that the present version is 5.3 and that code is no longer working.
This answer suggests the above line should work but it no longer does for me.
how to get current date/time as a date object in PHP
Can anyone suggest how to get this to work?