Date format problem...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Greg

    #1

    Date format problem...

    Isn't the following date format supposed to work with any installation of
    MySQL?

    YYYY-MM-DD HH:NN:SS

    It's not working on one system... the date is shown as all zero's.


  • Aggro

    #2
    Re: Date format problem...

    Greg wrote:[color=blue]
    > Isn't the following date format supposed to work with any installation of
    > MySQL?
    >
    > YYYY-MM-DD HH:NN:SS
    >
    > It's not working on one system... the date is shown as all zero's.[/color]

    Can you show example how to make it show all zeros? I would like to see
    something like this (Except in my example the datetime seems to work fine):


    mysql> create table datetimetest( col1 datetime );
    Query OK, 0 rows affected (0.02 sec)

    mysql> insert into datetimetest values( now() );
    Query OK, 1 row affected (0.00 sec)

    mysql> insert into datetimetest values( '2000-01-01 10:10:22' );
    Query OK, 1 row affected (0.00 sec)

    mysql> select * from datetimetest;
    +---------------------+
    | col1 |
    +---------------------+
    | 2004-07-30 19:59:38 |
    | 2000-01-01 10:10:22 |
    +---------------------+
    2 rows in set (0.01 sec)

    Comment

    • Bill Karwin

      #3
      Re: Date format problem...

      Greg wrote:
      [color=blue]
      > Isn't the following date format supposed to work with any installation of
      > MySQL?
      >
      > YYYY-MM-DD HH:NN:SS
      >
      > It's not working on one system... the date is shown as all zero's.[/color]

      Do you mean the date format when inserting, as in:
      insert into myTable (myDateColumn) values("2004-07-30 10:48:00");

      or do you mean the date format when selecting, as in:
      select date_format(myD ateColumn, "%Y-%m-%d %T") from myTable;

      Regards,
      Bill K.

      Comment

      Working...