Can you help me with JDBC getDate() error?
From: Spare Brain <spare_brain_at_yahoo.com>
Date: Tue, 1 Feb 2005 20:34:37 -0500
Message-ID: <ctp9m2$8d3_at_kcweb01.netnews.att.com>
Hi,
Date: Tue, 1 Feb 2005 20:34:37 -0500
Message-ID: <ctp9m2$8d3_at_kcweb01.netnews.att.com>
Hi,
I am observing a strange error with the time portion of the java.sql.Date() when using resultSet.getDate() - it always seems to show 12:00:00.
The following code prints 2004-10-27 11:00:00.0
String dtStr = resultset.getString("PROMISEDATE"); System.out.println(dtStr);
The following code prints 2004-10-27 12:00:00 java.util.Date dt = resultset.getDate("PROMISEDATE"); System.out.println(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(dt));
Any clue why the getDate screws up the time? Any remedies you may suggest?
Many thanks
SB
Received on Wed Feb 02 2005 - 02:34:37 CET