cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Pierson" <neil.pier...@gmail.com>
Subject Re: handling of "0" dates....
Date Wed, 08 Aug 2007 19:59:10 GMT
Starting from MySQL 5.0.2, MySQL gives warnings or errors if you try
to insert an illegal date. You can get MySQL to accept certain dates,
such as '1999-11-31', by using the ALLOW_INVALID_DATES SQL mode.
(Before 5.0.2, this mode was the default behavior for MySQL.).  If you
do not want to allow zero in dates, you can use the
NO_ZERO_IN_DATE SQL mode.  (With strict mode disabled, invalid dates
such as '2004-04-31' are converted to '0000-00-00' and a warning is
generated. With strict mode enabled, invalid dates generate an error.)

On 8/4/07, Michael Gentry <blacknext@gmail.com> wrote:
> Which is why I call setLenient(false) on the DateFormat instances I use.  :-)
>
> /dev/mrg
>
> On 8/4/07, Andrus Adamchik <andrus@objectstyle.org> wrote:
> > FWIW, Java calendar classes will do that too.
> >
> > Andrus
> >
> > On Aug 4, 2007, at 8:42 PM, Michael Gentry wrote:
> >
> > > What are you going to do February 31, 2007 is in the data?  Sadly,
> > > this is possible.  Actually, it has been a while since I played with
> > > MySQL and it may silently convert that to be March 3, 2007.
> > >
> > > /dev/mrg
> > >
> >
> >
>

Mime
View raw message