ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved