This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes suspicious datetime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "suspicious datetime" Watch "suspicious datetime" New topic

suspicious datetime

Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

when talking to a sqlserver 7.0 database, i have different dateformats for setting dates than for getting dates:
These are my statements:
create table datest (
dt datetime,
insert into datest values (
'2003-06-04 11:11:11.1', 1);
insert into datest values (
'2003-04-06 22:22:22.2', 2);
-- this what I get:
select * from datest;
--------------------- --
2003-04-06 11:11:11.11
2003-06-04 22:22:22.22
(see the values of dd and mm are the opposite).
I get this output with different drivers.
(jTDS, jNetDirekt) but only on msSQLserver,
not with HSQLdb or PostgreSQL.
Is this a known issue?
I didn' t find Help ad MSDN or by browsing Google- lotta datetime questions but not this one.
I agree. Here's the link:
subject: suspicious datetime
Similar Threads
Not able to find the added record in table.
dates between two dates
How to find the value for a particular key in a Hashmap
truncation errors storing a Date in MySQL table
Using two column functions to return a time span