I am assuming that localtime() returns the time in unix file format (number of
seconds since 12:00 AM on January 01, 1970). Why don't you convert 72 days to
seconds and subtract that number from the output of localtime()? 

For example, 72 days = 72 x 3600 x 24 seconds = 6220800 seconds

So, try:

--------------------------------------------------------------------------------

use POSIX qw(strftime);
 
my $SeventyTwoDaysAgo = strftime "%Y-%m%d", localtime() - 6220800;

--------------------------------------------------------------------------------

or something along these line.....



Quoting Rafael Morales <[EMAIL PROTECTED]>:

> Hi to all !!!
> 
> Now I have a new trouble with dates. How can I know the date of 72 days ago
> ?. For example for get 2005-12-05, I do this
> 
> use POSIX qw(strftime);
> 
> my $today = strftime "%Y-%m%d", localtime();
> 
> I would like to get this date: 2005-09-21.
> 
> Thanks list.
> 
> -- 
> _______________________________________________
> Get your free email from http://mymail.bsdmail.com
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 




----------------------------------------
This mail sent through www.mywaterloo.ca

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to