Set the time zone before calling date(). You will use date_default_timezone_set()for this:
date_default_timezone_set('UTC');
echo date("H:i:s", 0);
Look at the action
Do not forget to set it back if you perform operations with the time zone.
Or:
Here's an alternative way to do this with DateTime():
$dt = new DateTime('@0', new DateTimeZone('UTC'));
echo $dt->format('H:i:s');
Look in action
source
share