[ create a new paste ] login | about

Link: http://codepad.org/YPsh2xPA    [ raw code | output | fork ]

PHP, pasted on Feb 4:
1
2
3
4
5
6
7
<?
  $dtz = new DateTimeZone('America/Los_Angeles');
  $time_in_sofia = new DateTime('now', $dtz);
  $offset = $dtz->getOffset( $time_in_sofia ) / 3600;

  echo "GMT" . ($offset < 0 ? $offset : "+".$offset);
?>


Output:
1
GMT-8


Create a new paste based on this one


Comments: