Bad answer. If you 'guess', then don't answer. The idea behind the
date_format is to format a date as per user's need and should not be forced
to a particular format just because some countries follows some format.
Still looking for serious answer?




----- Original Message -----
From: "Harald Fuchs" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 04, 2002 6:26 PM
Subject: Re: Problem in inserting date


> In article <000901c20bc2$7b286100$221464a4@cimws34>,
> "R.C.Nougain" <[EMAIL PROTECTED]> writes:
>
> > create table dt (dt datetime);
> > --- OK
>
> > insert into dt values ( date_format('04/06/2002 13:48:38', '%d/%m/%Y
> > %H:%i:%s'));
> > --- Surprisingly it enters NULL
>
> Surprisingly only for those who don't read the MySQL documentation.
>
> > insert into dt values ( date_format('2002/04/06 13:48:38', '%Y/%d/%m
> > %H:%i:%s'));
> > --- Surprisingly (not really) it enters correct date
>
> > WHY is it so?
>
> I guess because in some languages/countries the day is in front of the
> month, whereas in others it's the other way round.
>
> > By simply moving the year part in first place makes the
> > statement to work properly. Why? Is it a MySQL bug.
>
> No, it's a documented feature.
>
> > I already invested almost a day in finding it out.
>
> You really should invest two hours or so in reading the documentation.
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to