Time::Piece::MySQL is a very useful module for MySQL users. It is simply an
extension to Time::Piece that provides a handful of methods for converting back and
forth between Time::Piece objects and the MySQL date/time types: date, time, datetime, and
timestamp. (The year type is available from Time::Piece, so it doesn't need to be here.)

As an example, say i had a table of events that contained an id and a datetime field: