The server on which I am hosted is hosted on PHP5.12.14, and I have an error when starting the DateTime object from PHP5.3.
$date = new DateTime($item_user['mem_updated']);
$date -> add(new DateInterval('P1D'));
error,
Fatal error: Call to undefined method DateTime::add() in /homepages/xxx.php on line xx
So, I was looking for other solutions, not sticking to the PHP5.3 DateTime object. How to write code to replace the above code?
Basically I have date and time data (e.g. 2011-01-21 02:08:39) from the mysql database, and I just need to add 1 day or 24 hours to this date / time, and then pass it to the function below.
$time_togo = time_togo($date -> format('Y-m-d H:i:s'));
thank.
source
share