[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [GT] SVN Commit r584 - trunk/GT/DateTime



GeniusTrader SVN wrote:
Author: thomas
Date: 2008-03-21 04:02:41 +0100 (Fri, 21 Mar 2008)
New Revision: 584

Modified:
   trunk/GT/DateTime/Year.pm
Log:
Make more resilient against incorrect date format.

Modified: trunk/GT/DateTime/Year.pm
===================================================================
--- trunk/GT/DateTime/Year.pm	2008-03-21 02:39:36 UTC (rev 583)
+++ trunk/GT/DateTime/Year.pm	2008-03-21 03:02:41 UTC (rev 584)
@@ -19,7 +19,8 @@
 =cut
 sub map_date_to_time {
     my ($date) = @_;
-    return timelocal(0, 0, 0, 1, 0, $date - 1900);
+    my ($y) = split /-/, $date;
+    return timelocal(0, 0, 0, 1, 0, $y - 1900);
 }
sub map_time_to_date {



i believe this change is incorrect!

the internal format for year is just YYYY, no months weeks days or hms

while it might be a good thing to attempt i'd suggest that it be
evaluated (extensively before committing)

ras