do not reinvent the wheel!! --
# you can get this on CPAN use Date::Parse; use POSIX; # assume your to-be-formatted date is in $date_in my $date_iso8601 = POSIX::strftime ("%Y-%m-%d %H:%M:%S", localtime (Date::Parse::str2time ($date_in))); tada!! the real magic is in str2time: it converts any legitimate date, in any format, into UNIX seconds-since-the-epoch. e.g. $sec = &str2time ("Oct 28 1975"); $sec = &str2time ("10/28/75"); $sec = &str2time ("October 28, 1975"); etc. etc. I just use the fully-qualified names because I detest having mysterious functions lurking around in my code (e.g. POSIX::ceil instead of just ceil, Date::Parse::str2time instead of just &str2time) Date::Parse is, needless to say, one of my all-time favorite tools. On Tue, 2 Apr 2002, Gabby Dizon wrote: ... > hello list friends, > > hope you can help me with my problem. here it is: > > i have a date string formatted this way: $date = "Apr. 02, 2002" i > want to capture the "Apr" (without the period) into $1, "02" into $2, > and "2002" into $3. note that some months may not be abbreviated (such > as May), and therefore might not have a period. my regex skills are > still sadly inferior (though i'm learning =) > > my second (and optional) problem for you to solve: i want to transform > this into mysql date format (yyyy-mm-dd). this is easy enough to do, > but i was wondering if there are any modules there that can date > manipulation a lot easier. if you know any, just let me know. -- Orlando Andico <[EMAIL PROTECTED]> Mosaic Communications, Inc. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]