diff -r adb7f8de8ce1 -r 7468a663315f includes/functions.php --- a/includes/functions.php Fri Feb 08 12:16:43 2008 -0500 +++ b/includes/functions.php Fri Feb 08 23:20:20 2008 -0500 @@ -251,8 +251,29 @@ { if ( !is_int($timestamp) && !is_double($timestamp) && strval(intval($timestamp)) !== $timestamp ) $timestamp = time(); - // FIXME: Offset $timestamp by user's timezone - return gmdate($string, $timestamp); + + /* + // List of valid characters for date() + $date_chars = 'dDjlNSwzWFmMntLoYyaABgGhHisueIOPTZFcrU'; + // Split them into an array + $date_chars = enano_str_split($date_chars); + // Emulate date() formatting by replacing date characters with their + // percentage-signed counterparts, but not escaped characters which + // shouldn't be parsed. + foreach ( $date_chars as $char ) + { + $string = str_replace($char, "%$char", $string); + $string = str_replace("\\%$char", $char, $string); + } + */ + + // perform timestamp offset + global $timezone; + // it's gonna be in minutes, so multiply by 60 to offset the unix timestamp + $timestamp = $timestamp + ( $timezone * 60 ); + + // Let PHP do the work for us =) + return date($string, $timestamp); } /**