By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,291 Members | 3,096 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,291 IT Pros & Developers. It's quick & easy.

Date format problem...

P: n/a
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.
Jul 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Greg wrote:
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.


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)
Jul 20 '05 #2

P: n/a
Greg wrote:
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.


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(myDateColumn, "%Y-%m-%d %T") from myTable;

Regards,
Bill K.
Jul 20 '05 #3

P: n/a
"Bill Karwin" <bi**@karwin.com> wrote in message
news:ce********@enews3.newsguy.com...
Greg wrote:
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.


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(myDateColumn, "%Y-%m-%d %T") from myTable;

Regards,
Bill K.


Like your first example. It happens when doing it from an application.
This is happening with MySQL v4.1 beta on one system (other systems are
using v4.0)
Jul 20 '05 #4

P: n/a
Greg wrote:
Like your first example. It happens when doing it from an application.
This is happening with MySQL v4.1 beta on one system (other systems are
using v4.0)


Echo/Print out the exact query (filled with values, not those containing
$variable or stuff like that) you are using and copy-paste it here.
Because most common reason for problems like this is that the query is
incorrectly formed.
Jul 20 '05 #5

P: n/a
"Bill Karwin" <bi**@karwin.com> wrote in message
news:ce********@enews3.newsguy.com...
Greg wrote:
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.


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(myDateColumn, "%Y-%m-%d %T") from myTable;

Regards,
Bill K.


Like your first example. It happens when doing it from an application.
This is happening with MySQL v4.1 beta on one system (other systems are
using v4.0)
Jul 20 '05 #6

P: n/a
Greg wrote:
Like your first example. It happens when doing it from an application.
This is happening with MySQL v4.1 beta on one system (other systems are
using v4.0)


Echo/Print out the exact query (filled with values, not those containing
$variable or stuff like that) you are using and copy-paste it here.
Because most common reason for problems like this is that the query is
incorrectly formed.
Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.