I use Date::Calc::Object and then you can use join('-', $datetime->date); to get the date in mysql format. For time you use join(':', $datetime->time).
Date::Calc is light weight and does alot of useful data and time calculations.
Storing localtime() in the database is almost always a bad idea, as you can't use the mysql date and time functions if you need them.
With split you can get the mysql dates and times back into Date::Calc.
-- gam3
A picture is worth a thousand words, but takes 200K.