473,548 Members | 2,598 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 2328
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(myD ateColumn, "%Y-%m-%d %T") from myTable;

Regards,
Bill K.
Jul 20 '05 #3
"Bill Karwin" <bi**@karwin.co m> 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(myD ateColumn, "%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.co m> 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(myD ateColumn, "%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
5050
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 date object with the date string which the user inputs from a pop up calendar. somewhat like this..........
6
31131
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 format exception (SQLSTATE=22007). The same queries worked fine on all the other workstations. The date format we want to use is "dd/mm/yyyy".After...
3
11573
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 overlap existing records from the same table. I had this all working some time ago, but recently when I have gone back to do more testing, part of...
7
31802
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 current date. If not, I'd like to display the error message to ValidationSummary. It seems to make sense to me to use CompareValidator but the...
12
29431
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 follows: function doDateCheckNow(source, args) { var oDate = document.getElementById(source.controltovalidate); // dd/mm/yyyy
16
11879
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 report of transactions between a Start & End date. The Tables and forms i believe are UK format "dd/mm/yyyy", However, when I click on "Review...
7
2086
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 report) from VB form based on an entered date in the masked fields (dd/mm/yy). I am using one form to display five reports. I send date to display report...
30
5664
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 database I have a table with Date/time column. The database is located on a machine that is set to dd/mm/yyyy also. When I enter date 7/1/08 (as in...
4
3043
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 the function using the intermediate window, it works fine. However, when I pass the dates from the code attached to my form, the results are inaccurate....
11
6169
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 days), weekly (for the last 6 weeks) and monthly (for the last 6 complete months). Daily and monthly are not causing me a problem - I have used the...
0
7512
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7438
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7707
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7803
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6036
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3495
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.