File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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!