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
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