RE: [PMX:#] Julian date to Date string format
by Joseph Youngquist other posts by this author
Jan 28 2003 4:26PM messages near this date
view in the new Beta List Site
[PMX:#] Julian date to Date string format
|
nested groups win2k
use Date::Manip;
my @dates = qw/2003001 2002365 2000180/;
foreach ( @dates ) {
my ($year, $days) = $_ =~ m/(\d{4})(\d{3})/;
my ($yr,$mon,$day,$hr,$mn,$sec)= &Date_NthDayOfYear($year, $days);
$mon = "0$mon" if ( length($mon) < 2 );
$day = "0$day" if ( length($day) < 2 );
my $MySqlDate = "$yr$mon$day";
print "\nMySql date: $MySqlDate";
}
hth,
JY
-----Original Message-----
From: perl-win32-users-admin@[...].com
[mailto:perl-win32-users-admin@[...].com]On Behalf Of
Fernando Freire Baez (Medicare)
Sent: Friday, January 31, 2003 10:53 AM
To: 'Perl-Win32-Users@listserv.ActiveState.com'
Subject: [PMX:#] Julian date to Date string format
Hello,
I have to insert a CSV file in MySQL database but some of the fields in the
file are in julian (e.g. 2003001) YYYYDDD. I have to convert this fields to
something like: YYYYMMDD. If any af you have to deal with this in the past
and have any code that can help me I will apreciate a lot. I try MySQL
functions but I can't find any that solve the situation. Really, I will
apreciate a lot as always.
Fernando Freire Baez
Programador Analista I
Triple S / Medicare
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Fernando Freire Baez (Medicare)
Joseph Youngquist
|