Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use CGI; use CGI::Carp qw/fatalsToBrowser warningsToBrowser/; use Date::Calc qw(Delta_Days); use Date::Calc qw[Add_Delta_Days Today]; my $q = new CGI; print $q->header; my $got_date = "1/1/2010"; # this is only to show, but this is the for +mat of the date I will be getting from the db table. my ($got_month,$got_day,$got_year) = split /\//, $got_date; # split da +te in 3 parts with / as delimiter my ($year, $month, $day) = Today(); my @today = ($year, $month, $day); my @date_got = ($got_year, $got_month, $got_day); my $difference = Delta_Days(@date_got, @today); print "There were $difference days between Today and Stored Date\n\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Subtracting certain number of days from current date.
by stefbv (Priest) on Feb 03, 2010 at 20:17 UTC | |
by keszler (Priest) on Feb 03, 2010 at 20:26 UTC | |
|
Re: Subtracting certain number of days from current date.
by ahmad (Hermit) on Feb 04, 2010 at 00:12 UTC | |
|
Re: Subtracting certain number of days from current date.
by ikegami (Patriarch) on Feb 03, 2010 at 20:03 UTC | |
by Anonymous Monk on Feb 03, 2010 at 20:10 UTC |