I'm working with an external vendor that is performing an HTTP GET to my server to submit delivery reports. All is working except I can't convert the timestamp into my local format. The timestamps are submitted like this:
Mon, 15 Aug 2005 15:51:01 +0000
I then need to convert to a different format in my local timezone. This is my current code:
date_default_timezone_set('UTC'); $ts = $_GET['skebby_date_time']; $date = DateTime::createFromFormat('D, d M y H:i:s O', $ts); $date->setTimeZone(new DateTimeZone("Australia/Sydney")); $fmTimestamp = $date->format('m/d/Y h:i:s A');
This is currently generating a Fatal error: Call to a member function setTimeZone() on a non-object for this line:
I've used similar code for other timestamps so not sure what I'm doing wrong at this point.