Handling DST with explicit offsets : gmstrftime « Date « PHP






Handling DST with explicit offsets

 
<?php

$now = time();

$now -= 8 * 3600;

$ar = localtime($now,true);
if ($ar['tm_isdst']) { $now += 3600; }

print gmstrftime('%c',$now);
?>
  
  








Related examples in the same category

1.Adjusting time from UTC to another time zone