Re: Problem in inserting date

2002-06-05 Thread R.C.Nougain

Hi All those responded!

Thanks Thomas Spahni and Jan. First thing fisrt. I did see the manual doc
pages (a lot) when I was trying the date_format function. Once I could not
succeed (and could not understood the docs) I posted my question. Now the
point is that date_format is not really for formatting the *input* date into
the MySQL but for formatting the date for *output*. Thanks all those
responded. But just wondering as why the INSERT command silently takes
date_format(xxx, xxx) stuff.

Thanks  Regards


- Original Message -
From: Thomas Spahni [EMAIL PROTECTED]
To: R.C.Nougain [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, June 04, 2002 7:23 PM
Subject: Re: Problem in inserting date


 On Tue, 4 Jun 2002, 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?

 RC,

 seriously, date_format determines the format of what you get out of this
 function, and not the format of the input. When you want to feed it a
 string, this string must be parsed and must be in a representation
 suitable to MySQL. By definition this is '/mm/dd'.

 What you are looking for is a completely different function not yet
 available in MySQL. It would take a string, interprete it according to a
 given template and would then return the date in 'standard'
 representation.

 Thomas Spahni



-
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




Problem in inserting date

2002-06-04 Thread R.C.Nougain

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

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 want the first insert to work properly. But it seems it is
not working. By simply moving the year part in first place makes the
statement to work properly. Why? Is it a MySQL bug. Please respond. I
already invested almost a day in finding it out.

Thanks



-
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




Re: Problem in inserting date

2002-06-04 Thread R.C.Nougain

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




How to start the server

2002-01-07 Thread R.C.Nougain

Newbee! Loaded binaries (not RPM or Package) on RH Linux7.2. How to start
the MySQL server manually and how to configure it (ie port on which it is
running). Not finding the proper documentation page on www.mysql.com.


-
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