Hi vmalik -
  
At 2005-12-05, 07:09:51 you wrote:
>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()? 

No. time() returns epoch seconds ( seconds since 1-1-70 ), localtime() returns
an array or formatted scalar. See perldoc -f time, 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>
>
>
>
>
>-- 
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.1.362 / Virus Database: 267.13.11/191 - Release Date: 12/2/2005
>


                        
Aloha => Beau;
[EMAIL PROTECTED]
2005-12-05



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