// Copyright: Copyright (C) 2004-2007 Pristine Communications // timezone_iso: Return the timezone in ISO 8601 format function timezone_iso() { // Cache the result static $cache; // Return the cache if (isset($cache)) { return $cache; } // Calculate the time zone string $tzsec = date("Z"); $tzsign = ($tzsec >= 0? "+": "-"); $tzsec = abs($tzsec); $tzmin = floor($tzsec / 60); $tzsec = $tzsec % 60; $tzhr = floor($tzmin / 60); $tzmin = $tzmin % 60; $tz = sprintf("%s%02d:%02d", $tzsign, $tzhr, $tzmin); // Cache it $cache = $tz; return $tz; } ?>