What's the easiest way to get the UTC offset in PHP, relative to the current (system) timezone?
+1
A:
$this_tz_str = date_default_timezone_get();
$this_tz = new DateTimeZone($this_tz_str);
$now = new DateTime("now", $this_tz);
$offset = $this_tz->getOffset($now);
Untested, but should work
John Millikin
2008-10-11 01:06:20
Useful if you're using the DateTime class in PHP 5. But I'm not.
Adam Ernst
2008-10-11 01:36:40