registry =& $registry; $this->servertz = date('Z', TIMENOW) / 3600; } /** * Computes the total offset, taking into account all * the various options */ function fetch_offset() { $this->offsettz = $this->servertz - $this->usertz; $this->offset = $this->offsettz * 3600; } /** * Formats a UNIX timestamp to a certain date format in the proper time zone * * @param string Format of the date (same as PHP's date() function) * @param integer UNIX timestamp to format * @param bool Adjust the date to the user's language? * * @return string Formatted date */ function format($format, $timestamp = TIMENOW, $adjust = true) { if ($adjust) { $timestamp -= $this->offset; } return date($format, $timestamp); } } /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>