in reply to Date processor

I'm not sure what format MySQL's date field is, but Time::ParseDate will parse your example string into a Unix format (# seconds since the epoch).
use Time::ParseDate; my $time=parsedate("2-19-01 3:22 PM"); print scalar localtime($time),"\n";

Replies are listed 'Best First'.
Re: Re: Date processor
by tadman (Prior) on Feb 23, 2001 at 22:48 UTC
    The easy way to use this more elegant approach of mr.nick would be to INSERT using the MySQL helper function:     INSERT INTO x (y) VALUES (FROM_UNIXTIME(?)); You might want to check out 7.4.11 of the MySQL docs for more detailed information.
Re: Re: Date processor
by sierrathedog04 (Hermit) on Feb 24, 2001 at 00:17 UTC
    I'm with you. I think that using CPAN modules for converting dates, XML etc. is preferable to rolling one's own regexes. There is just too much opportunity for mischief with malformed dates, leap years, invalid input, etc.

    Personally I prefer Date::Manip for these sorts of tasks, but to each his own. Or a Serge Gainsbourg said, "A son gout est l'appetit, l'appetit est a son gout." (One's taste is according to one's appetite, one's appetite is according to one's taste.")