Received: from send205.yahoomail.com (send205.mail.yahoo.com [128.11.68.129]) by hub.org (8.9.2/8.9.1) with SMTP id RAA62397 for ; Mon, 1 Feb 1999 17:16:16 -0500 (EST) (envelope-from peter_garner@yahoo.com) Message-ID: <19990201221611.27552.rocketmail@send205.yahoomail.com> Received: from [208.16.26.149] by send205.mail.yahoo.com; Mon, 01 Feb 1999 14:16:11 PST Date: Mon, 1 Feb 1999 14:16:11 -0800 (PST) From: Peter Garner Subject: Re: [INTERFACES] Re: ResultSet.getDate To: Peter T Mount , "Thomas G. Lockhart" Cc: pgsql-interfaces@postgreSQL.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hi All! :-) Here is an even better one for you! ;-) It seems that Java, not JDBC is chopping the time portion in doing the conversion from a java.util.Date to a java.sql.Date (ResultSet.getDate converts them) Try the following, please : import java.sql.* ; import java.text.* ; import java.util.* ; class DateTest { // Public Methods public static void main ( String strgarrArgs [] ) { try { SimpleDateFormat sdf = new SimpleDateFormat ( "dd MMM yyyy HH:mm:ss" ) ; java.util.Date date = new java.util.Date ( "01 Feb 1999 16:08:00" ) ; System.out.println ( "\nDate is:\t" + sdf.format ( date ) ) ; java.sql.Date sqldate = new java.sql.Date ( date.getTime () ) ; System.out.println ( "SQL Date is:\t" + sdf.format ( sqldate ) + "\n" ) ; } /* endtry */ catch ( Exception e ) { System.out.println ( "\nCaught an Exception of type " + e.getClass ().getName () ) ; System.out.println ( e.getMessage () ) ; } /* endcatch */ } /* static void main ( String strgarrArgs [] ) */ } /* class DateTest */ On my machine at least the output is : Date is: 01 Feb 1999 16:08:00 SQL Date is: 01 Feb 1999 00:00:00 Looks like a definite bug in the JVM or just in the Blackdown Linux v1.17 JVM! ;-) Thanks again! == Peace, Peter We are Microsoft of Borg, you will be assimilated!!! Resistance is fut... ***BZZZRT*** THUD!!! [General Protection Fault in MSBorg32.DLL] Please contact the vendor for more information _________________________________________________________ DO YOU YAHOO!? Get your free @yahoo.com address at http://mail.yahoo.com