kathys39 has asked for the wisdom of the Perl Monks concerning the following question:

Anyone know of a quick and easy way to convert a date like "Wed Apr 4 16:36:01" to a date that will go into mysql? Other than splitting the line and rearranging - that I can do easily. I just thought there might be a function already out there that does this. I'm reading this date format from an nmap xml file, and that's how it writes the date out...
  • Comment on convert date of Wed Apr 4 to mysql formta

Replies are listed 'Best First'.
Re: convert date of Wed Apr 4 to mysql formta
by svenXY (Deacon) on Oct 11, 2007 at 14:27 UTC
Re: convert date of Wed Apr 4 to mysql formta
by cormanaz (Deacon) on Oct 11, 2007 at 22:21 UTC
    You can also have a look at Date::Manip. It's one my my favorite mods. Its ParseDate function can parse just about anything that looks like a date, then you can use its UnixDate function to create a string that MySQL will like. Has a ton of other useful date functions too.

    Steve