Use the POSIX function strftime:


#!/usr/local/bin/perl -w

use POSIX;
print "The date is : ",POSIX::strftime("%m%d%Y",localtime()),"\n";

-- snip --

[notjames@concon notjames]$ perl -MPOSIX -e '
 > print "The date is : ",POSIX::strftime("%m%d%Y",localtime()),"\n";
 > '
The date is : 07252001

-- !snip --

Now, you mentioned conversion so if that involves sucking in a date from 
something else other than the system you will have to be more specific in 
origin to convert from ie a filename or something.

Hope this helps.

- Jim

At 12:22 PM 07.25.2001 -0400, F.H wrote:
>Hi,
>does anyone know how to convert a date from mmddyy to mmddyyyy?
>so 010201 becomes 01022001
>
>Thanks for your help
>
>I.S
>
>
>__________________________________________________________________
>Your favorite stores, helpful shopping tools and great gift ideas. 
>Experience the convenience of buying online with Shop@Netscape! 
>http://shopnow.netscape.com/
>
>Get your own FREE, personal Netscape Mail account today at 
>http://webmail.netscape.com/
>
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



- Jim

-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
http://www.perlmonks.org/index.pl?node_id=67861&lastnode_id=67861

-----BEGIN PERL GEEK CODE BLOCK-----      ------BEGIN GEEK CODE BLOCK------
Version: 0.01                             Version: 3.12
P++>*@$c?P6?R+++>++++@$M                  GIT/CM/J d++(--) s++:++ a-
 >++++$O!MA->++++E!> PU-->+++BD            C++++(+) UB++++$L++++$S++++$
$C-@D!>++++(-)$S++++@$X?WP+>++++MO!>+++   P++(+)>+++++ L+++(++++)>+++++$ !E*
+PP+++>++++n-CO?PO!o >++++G               W++(+++) N+ o !K w--- PS---(-)@ PE
 >*(!)$A-->++++@$Ee---(-)Ev++uL++>*@$uB+   Y+>+++ PGP t+(+++)>+++@ 5- X++ R@
 >*@$uS+>*@$uH+uo+w-@$m!                   tv+ b? DI-(+++) D+++(++) G(++++)
------END PERL GEEK CODE BLOCK------      ------END GEEK CODE BLOCK------


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

Reply via email to