473,498 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
Jul 20 '05 #1
6 2318
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
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
"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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5047
by: amith | last post by:
hi I have written javascript for comparing two dates in US format and finding out whether the start date is greater than the end date and vice versa. In this attempt i have instantiated the...
6
31127
by: Dario Di Bella | last post by:
Hi all, we have the following urgent issue affecting our development team. Initially we had one particular workstation that failed executing queries on a DB2 database, raising an invalid date...
3
11563
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
7
31790
by: James P. | last post by:
Hello there, In my asp.net page using VB, I have a date text field in mm/dd/yyyy format. When a date is entered, I'd like to validate it to make sure the date is greater than or equal to the...
12
29419
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
16
11876
by: Mik | last post by:
I apologise if this post seems a little basic, but I am a newbie and have NO access knowledge. I have downloaded the Accounts Ledger from the Microsoft Website. It allows the user to review a...
7
2084
by: creative1 | last post by:
Hello everyone. I am experiencing a strange problem that I can't fix on my own. I think I need expert's suggestions for this. The problem is: I want to print account statement (or any other...
30
5639
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
4
3036
by: OzNet | last post by:
I have some functions to calculate the working days in a given period. This includes a table that is queried to calculate the number of public holidays that don’t occur on a weekend. If I test...
11
6159
ollyb303
by: ollyb303 | last post by:
Hello, I am using a dynamic crosstab report to track performance statistics for my company and I have hit a problem. I would like the option to track stats daily (for the last 7 complete...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7004
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
657
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
292
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.