From: ndparker <> Date: Sun, 17 Jun 2001 04:40:35 +0000 (+0000) Subject: German.pm: added version check, turned 'germantime' to 'localtime'. Time::German... X-Git-Url: https://git.p6c8.net/selfforum.git/commitdiff_plain/9218fb0859abdc5a09758bed809b26902ae179d6 German.pm: added version check, turned 'germantime' to 'localtime'. Time::German now overwrites the CORE::localtime function _lib.pm returned 'germantime' to 'localtime' --- diff --git a/selfforum-cgi/shared/Posting/_lib.pm b/selfforum-cgi/shared/Posting/_lib.pm index 4ca1514..1f6de85 100644 --- a/selfforum-cgi/shared/Posting/_lib.pm +++ b/selfforum-cgi/shared/Posting/_lib.pm @@ -683,26 +683,26 @@ sub month($) { } sub hr_time ($) { - my (undef, $min, $hour, $day, $mon, $year) = germantime (shift); + my (undef, $min, $hour, $day, $mon, $year) = localtime (shift); sprintf ('%02d. %s %04d, %02d:%02d Uhr', $day, month($mon+1), $year+1900, $hour, $min); } sub short_hr_time ($) { - my (undef, $min, $hour, $day, $mon, $year) = germantime (shift); + my (undef, $min, $hour, $day, $mon, $year) = localtime (shift); sprintf ('%02d. %02d. %04d, %02d:%02d Uhr', $day, $mon+1, $year+1900, $hour, $min); } sub long_hr_time ($) { my @wday = qw(Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag); - my ($sek, $min, $hour, $day, $mon, $year, $wday) = germantime (shift); + my ($sek, $min, $hour, $day, $mon, $year, $wday) = localtime (shift); sprintf ('%s, %02d. %s %04d, %02d:%02d:%02d Uhr', $wday[$wday], $day, month($mon+1), $year+1900, $hour, $min, $sek); } sub very_short_hr_time($) { - my (undef, $min, $hour, $day, $mon, $year) = germantime (shift); + my (undef, $min, $hour, $day, $mon, $year) = localtime (shift); sprintf ('%02d. %02d. %04d', $day, $mon+1, $year+1900); } diff --git a/selfforum-cgi/shared/Time/German.pm b/selfforum-cgi/shared/Time/German.pm index 52d7153..2e323d0 100644 --- a/selfforum-cgi/shared/Time/German.pm +++ b/selfforum-cgi/shared/Time/German.pm @@ -11,13 +11,23 @@ package Time::German; ################################################################################ use strict; +use vars qw( + @EXPORT + $VERSION +); + +################################################################################ +# +# Version check +# +$VERSION = do { my @r =(q$Revision$ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; ################################################################################ # # Export # use base 'Exporter'; -@Time::German::EXPORT = qw(germantime); +@EXPORT = qw(localtime); ################################################################################ # @@ -42,7 +52,7 @@ my %summertime = ( 95 => [84, 266] ); -### germantime () ############################################################## +### localtime () ############################################################### # # like 'localtime', but system independent # @@ -50,7 +60,7 @@ my %summertime = ( # # Return: same as localtime, but german time ;-) # -sub germantime (;$) { +sub localtime (;$) { my $time = shift; $time = time unless defined $time;