[Dbix-class] Re: Question about handling of undefined times with DBIx::Class::InflateColumn::DateTime

James Munson jmunson at gmail.com
Fri Feb 22 19:58:55 GMT 2008


I'd just like to give a quick update: Apparently if you set it so the field
allows nulls, it will return a null value instead of all 0s and make
everything else behave properly. This might not be acceptable for some
situations, but works well in mine. Maybe this should be pointed out
somewhere in the documentation?

On Fri, Feb 22, 2008 at 12:51 PM, James Munson <jmunson at gmail.com> wrote:

> I know this has been touched on before a few years ago, but I can't seem
> to track down any fix or 'official workarounds'.
> The problem is that MySQL's default dates are all 0s, and DateTime has no
> means of representing them(that I can see).
>
> This leads to the error of
>
> undef error - The 'month'
> parameter ("00") to DateTime::new did not pass the 'is between 1 and 12' =
callback at /usr/local/share/perl/5.8.7/DateTime/Format/Builder/Parser/Rege=
x.pm line 135
>
> There is a closed ticket on the issue at
> http://rt.cpan.org/Public/Bug/Display.html?id=3D7589 for more info, but
> short of changing your database I can't really find a clean solution to t=
he
> problem. He mentioned doing a regexp check before using DateTime, but with
> InflateColumn I'm not sure if I even could do that if I wanted to. Does
> anyone have any good workarounds for this problem?
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080222/dfd=
5bb07/attachment.htm


More information about the DBIx-Class mailing list