There are always a hundred ways to do something, and others might know a
better way, but I'd use a sprintf statement to zero-pad your date values
like this:

 my $date_added = sprintf("%04d%02d%02d", $year $mon $mday);

Make sure you adjust the values of year month & day from the raw values
supplied by localtime before you do this.

Good luck!
Matt

-----Original Message-----
From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]] 
Sent: Monday, August 06, 2001 5:05 PM
To: Beginners (E-mail)
Subject: Explaining myself correctly RE: SORTING BY DATE


List,

Please accept my sicerest apologies for not explaining myself correctly
in my last post (RE: SORTING BY DATE).

What I really need to be able to do is have my script display the date
as YEAR (xxxx) MONTH (xx) DAY (xx)

For egsamle todays date would be displayed as 20010807 

At the moment I can display the date as 7/8/2001 but I really need the
zeros in there and displayed as year first.  The code for this is as
follows...

my $lt                    = localtime;
my $date_added     = $lt->mday . '/' . ($lt->mon + 1) . '/' . ($lt->year
+
1900);

Any ideas?

Kind Regards,

Daniel Falkenberg

==============================
VINTEK CONSULTING PTY LTD
(ACN 088 825 209)
Email:  [EMAIL PROTECTED]
WWW:    http://www.vintek.net
Tel:    (08) 8523 5035
Fax:    (08) 8523 2104
Snail:  P.O. Box 312
        Gawler   SA   5118
==============================


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



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

Reply via email to