From: Barijaona Ramaholimihaso Date: Tue, 2 Oct 2007 18:59:06 +0000 (+0000) Subject: Handle correctly seconds in the nice_date subroutine X-Git-Tag: v2_1_0~42 X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=9a087c9217a62dd4c1e03d409195ffb98b3c7c61;p=matthijs%2Fupstream%2Fblosxom.git Handle correctly seconds in the nice_date subroutine --- diff --git a/blosxom.cgi b/blosxom.cgi index 44d438c..7c669dd 100755 --- a/blosxom.cgi +++ b/blosxom.cgi @@ -694,16 +694,16 @@ sub nice_date { my ($unixtime) = @_; my $c_time = CORE::localtime($unixtime); - my ( $dw, $mo, $da, $hr, $min, $yr ) + my ( $dw, $mo, $da, $hr, $min, $sec, $yr ) = ( $c_time - =~ /(\w{3}) +(\w{3}) +(\d{1,2}) +(\d{2}):(\d{2}):\d{2} +(\d{4})$/ + =~ /(\w{3}) +(\w{3}) +(\d{1,2}) +(\d{2}):(\d{2}):(\d{2}) +(\d{4})$/ ); $ti = "$hr:$min"; $da = sprintf( "%02d", $da ); my $mo_num = $month2num{$mo}; my $offset - = timegm( 00, $min, $hr, $da, $mo_num - 1, $yr - 1900 ) - $unixtime; + = timegm( $sec, $min, $hr, $da, $mo_num - 1, $yr - 1900 ) - $unixtime; my $utc_offset = sprintf( "%+03d", int( $offset / 3600 ) ) . sprintf( "%02d", ( $offset % 3600 ) / 60 );