in reply to Expand Class::DBI Field to DateTime Object
This approach works really well, but I've been caught out by the way it handles unknown or undefined times.
MySQL stores unrecognised date/times as 0000-00-00 00:00:00, as described in the MySQL manual. In the case of TIMESTAMP fields, unknown values are also stored in this form, as opposed to using NULL.
I've worked around this problem by storing timestamps that may not exist in external tables and referencing them using Class::DBI's might_have relationship.