Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Expand Class::DBI Field to DateTime Object

by tomhukins (Curate)
on Sep 10, 2004 at 14:22 UTC ( #390082=note: print w/ replies, xml ) Need Help??


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.

I've raised a bug report for this in RT. Although it's a documented feature of MySQL, I appreciate the argument that DateTime::Format::MySQL shouldn't have to work around it.


Comment on Re: Expand Class::DBI Field to DateTime Object
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://390082]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2015-07-04 02:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls