Gossamer Forum
Quote Reply
GT::Date issue
For some reason when i try to increment a date variable it gets stuck on the last day of october. Just keeps repeating.

CODE:
#!/usr/bin/perl5
use strict;
use lib '/path to admin/cgi-bin/links/admin';
use Links qw/$IN/;
use CGI::Carp qw(fatalsToBrowser);
use GT::Date qw/:all/;
local $SIG{__DIE__} = \&Links::fatal;
Links::init('/path to admin/cgi-bin/links/admin');

print $IN->header();
my $duration = 60;
my $date = "2004-10-01";
for (my $i=0; $i < $duration; $i++) {
print "$date<br>";
$date = date_add($date, 1);

}
exit;

OUTPUT:
2004-10-25
2004-10-26
2004-10-27
2004-10-28
2004-10-29
2004-10-30
2004-10-31
2004-10-31
2004-10-31
2004-10-31
2004-10-31
2004-10-31

Any body know why it wont go past october? it doesnt doesnt work even if i change the year to 2005.

Thanks

Hagai
Subject Author Views Date
Thread GT::Date issue hagai 4196 Mar 9, 2005, 9:10 AM
Post Re: [hagai] GT::Date issue
hagai 4089 Mar 9, 2005, 9:54 AM
Thread Re: [hagai] GT::Date issue
Andy 4104 Mar 9, 2005, 10:00 AM
Thread Re: [Andy] GT::Date issue
hagai 4082 Mar 9, 2005, 11:02 AM
Thread Re: [hagai] GT::Date issue
Andy 4088 Mar 9, 2005, 11:16 AM
Post Re: [Andy] GT::Date issue
hagai 4064 Mar 9, 2005, 11:44 AM