--- James Parsons <[EMAIL PROTECTED]> wrote:
> Good Morning all   

Good morning, James. =o)

> Since I'm still a Newbie when it comes to Perl , so my question may
> sound fairly simple to the group but here goes..
> I need to create a  file that has the localtime  - 1 day and -2 days.
> and then redirect this to 2 separate files. 

"- 1 day and -2 days" ???
Do you mean the local time *minus* a day and then 2?
Try this:

 my $day = 60 * 60 * 24; # seconds, minutes, hours
 my $now = time;
 my $yesterday = $now - $day;
 my $previous = $yesterday - $day;

Then you can print the dates/times like this:

 print scalar localtime($_),"\n" for ($now, $yesterday, $previous);

for which I currently get

 Tue Nov 12 09:04:13 2002
 Mon Nov 11 09:04:13 2002
 Sun Nov 10 09:04:13 2002

Now, are you saying you want to set the file datestamp to those
times???
If so, check out the utime() command in perlfunc.

  perldoc -f utime

Have fun. ;o]

__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to