On 4 Jun 2002 at 18:57, R.C.Nougain wrote:

> 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?

Good answer. You should have read the documentation, especially after getting 
the response. date_format will structure the *output* of date_format to 
whatever format you want, but it's input has to be in the format it expects.

See:
<http://www.mysql.com/doc/D/a/Date_and_time_types.html>
and
<http://www.mysql.com/doc/D/a/Date_and_time_functions.html>

So a line like:
insert into dt values ( date_format('2002-04-06 13:48:38', '%d/%m/%Y 
%H:%i:%s'));

will insert a value of:
06/04/2002 13:48:38
into dt
Note that the output date has been reformatted to fit the format string. The 
format string does *not* specify the format of the input. That part is fixed 
as year followed by month followed by day.
-jan

> ----- Original Message -----
 
[snipped to conserve bandwidth]
filter fodder - sql, query

---------------------------------------------------------------------
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