develooper Front page | perl.datetime | Postings from February 2003

offset_as_string, a patch

Thread Next
From:
kellan
Date:
February 12, 2003 22:41
Subject:
offset_as_string, a patch
Message ID:
Pine.LNX.4.52.0302130138380.13682@protestnet
diff -Naur DateTime/TimeZone.pm DateTime_abs/TimeZone.pm
--- DateTime/TimeZone.pm	2003-02-13 06:38:41.000000000 +0000
+++ DateTime_abs/TimeZone.pm	2003-02-13 06:39:29.000000000 +0000
@@ -249,7 +249,7 @@
     my $sign = $offset < 0 ? '-' : '+';
 
     my $hours = $offset / ( 60 * 60 );
-    $hours %= 24;
+    $hours = abs($hours) % 24;
 
     my $mins = ( $offset % ( 60 * 60 ) ) / 60;
 

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About