This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
It's not a secret anymore!