I've been looking for a while, it used to work but it does'nt anymore and I can't find why. Does one of you have an idea?
$utc_time = DateTime::createFromFormat('Y-m-d H:i:s', $time, new DateTimeZone('US/Eastern'));
$utc_time->setTimeZone(new DateTimeZone("UTC")); // This line returns the error.
return $utc_time->format($dateformat);
I get this error: Fatal error: Call to a member function setTimeZone() on a non-object
.
Thanks a lot for your help, I hope it's something dumb and that I was just lost...