strtotime()parsing is always done with the current time zone,
unless a different time zone is specified in the string that is parsed:
<?php
echo date("H:i T\n", strtotime("09:22")); // shows 09:22 CET
echo date("H:i T\n\n", strtotime("09:22 GMT")); // shows 10:22 CET
echo gmdate("H:i T\n", strtotime("09:22")); // shows 08:22 GMT
echo gmdate("H:i T\n", strtotime("09:22 GMT")); // shows 09:22 GMT
?>
Using the strtotime()function is easy. It accepts two parameters: the
string to parse to a timestamp and an optional timestamp. If the
timestamp is included, the time is converted relative to the
timestamp; if it’s not included,the current time is used. The relative
calculations are only written with yesterday, tomorrow, and the 1
year 2 days ago format strings.
unless a different time zone is specified in the string that is parsed:
<?php
echo date("H:i T\n", strtotime("09:22")); // shows 09:22 CET
echo date("H:i T\n\n", strtotime("09:22 GMT")); // shows 10:22 CET
echo gmdate("H:i T\n", strtotime("09:22")); // shows 08:22 GMT
echo gmdate("H:i T\n", strtotime("09:22 GMT")); // shows 09:22 GMT
?>
Using the strtotime()function is easy. It accepts two parameters: the
string to parse to a timestamp and an optional timestamp. If the
timestamp is included, the time is converted relative to the
timestamp; if it’s not included,the current time is used. The relative
calculations are only written with yesterday, tomorrow, and the 1
year 2 days ago format strings.