Php – remove 5 hours from the time

datetimephpstrtotime

I'm using strtotime to create a timestamp from some ropey XML, but the timezone is incorrect.

How can I remove 5 hours from the time?

Best Solution

If you know the timezone, you can set it with date_default_timezone_set()

When that's set, you can just do this in strtotime() as you know.

strtotime("-5 hours", $time);