Weigert, Thomas wrote:
ras, I think you are confusing the "internal" format from what is allowed in the textual representation.
very possible
All this change does is to allow you to use "2000-04-08", for example, on the command line, but turn it into "2000" as used internally. There are absolutely no differences you will see, other than "2000-04-08" not failing. Th.-----Original Message----- From: Robert A. Schmied [mailto:ras
AT acm.org]
Sent: Friday, March 21, 2008 12:31 PM To: devel
AT geniustrader.org
Subject: 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 (rev583)+++ trunk/GT/DateTime/Year.pm 2008-03-21 03:02:41 UTC (rev584)@@ -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