Here is a shot taking in mmddyy and giving mmddyyyy:
Code starts on next line(Lines with #Use are what is needed):
#!perl -w
use Time::Local; #Use
my $Dates = '010201';
my @DateUse = ();
while ( $Dates =~ /(\d{2}){1}/g ) {
printf "%-s\n",$1;
push(@DateUse,$1);
}
printf "%d\n", scalar(@DateUse);
if ( ! (scalar(@DateUse) and ! (scalar(@DateUse) % 3) ) ) {
die "Expecting groups of 3 for date calculations:$!";
}
for(my $MyId=0;$MyId<scalar(@DateUse);$MyId+=6) {
my $t1 =
timelocal(0,0,12,$DateUse[$MyId+1],$DateUse[$MyId]-1,$DateUse[$MyId+2]);
#Use Use hour 12
printf "t1: %9d\n", $t1,;
my $MyTime1 = localtime($t1);
printf "LocalTime1: %-s\n", $MyTime1;
my @MyTimeInfo = localtime($t1);
printf "%02d%02d%04d\n", $MyTimeInfo[4]+1, $MyTimeInfo[3],
(1900+$MyTimeInfo[5]);
}
^---Code ends here
Starting point for you.
Wags ;)
Wags ;)
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 25, 2001 09:23
To: [EMAIL PROTECTED]
Subject: Date problem
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]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]