Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

remove 5 hours from the time

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?

like image 716
Tom Avatar asked Jan 21 '26 13:01

Tom


1 Answers

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);
like image 150
Ólafur Waage Avatar answered Jan 24 '26 01:01

Ólafur Waage



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!