Or you can just use localtime();

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
my $date = ($year + 1900).($mon + 1).$mday;

mkdir($date);

-----Original Message-----
From: Dave Cross
To: [EMAIL PROTECTED]
Sent: 2/2/02 1:01 AM
Subject: Re: Dates in file or directory names ?

On Thu, 31 Jan 2002 21:20:16 +0000, Mark Richmond wrote:

> Ok, so I'm confused
> What I want to do is create a directory where the name is the current
> date say mkdir(2002131)
> What Can't figure out is how to build the date string. I'm sure I'm
> just missing something.
> Any thoughts.

[can you please try to configure your mail client not to use HTML]

You probably need the "strftime" function from the POSIX module.

my $date = strftime('%Y%m%d', localtime);


hth,

Dave...

-- 

  "Don't you boys know any _nice_ songs?"

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


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

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

Reply via email to