Mad Hatter wrote:
> I am writing a cgi script to run as a cron job. when
> it runs i need the date of 'one year ago today' in the
> format 'YYYY-MM-DD' to be stored in a variable to be
> used later in the script. I am about as dumb as wet
> dirt when it comes to cgi. Can someone please help me
> with this?
>
have you try Date::Manip? like:
#!/usr/bin/perl -w
use strict;
use Date::Manip;
my $date = ParseDate('1 year ago');
print UnixDate($date,'%Y'),'-',
UnixDate($date,'%m'),'-',
UnixDate($date,'%d'),"\n";
__END__
prints:
2002-01-21
david
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]