Name: krT82822 Date: 04/18/99
orig synopsis: "SQL Date get*() methods have internal bugs which cause exceptions"
This code:
public class sqlbug {
public static void main( String[] args ) {
java.sql.Date date = new java.sql.Date( 0102030405 );
System.out.println( "date is " + date.toString() );
System.out.println( "hours: " + date.getHours() );
}
}
Fails to operate with error:
date is 1970-01-01
java.lang.IllegalArgumentException
at java.sql.Date.getHours(Date.java:131)
at sqlbug.main(sqlbug.java:6)
Similarily for getMinutes(), getSeconds().
I haven't tried compiling the code under Java2.
(Review ID: 56957)
======================================================================