I'm trying to convert a timestamp that's stored in a database from the MM/DD/YYYY HH:MM:SS format to DD/MM/YYYY HH:MM:SS format but I'm getting an error
"PHP Fatal error: Call to a member function format() on a non-object"
Here's my code:
date_default_timezone_set('Australia/Sydney');
$clientTimestamp = '10/25/2015 21:22:47';
$date = DateTime::createFromFormat("m/d/Y h:i:s", $clientTimestamp );
$clientTimestampAU = $date->format("d/m/Y h:i:s");
I'm getting the error on the last line - I can't work out what the issue is here.
m/d/Y H:i:sandd/m/Y H:i:s.... upper-caseHfor 24-hr clock