Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4230699

Fix 1.1 docs for java.sql.Date.getHours/Minutes/Seconds() to note deprecation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.1.8
    • 1.1.7
    • docs
    • 1.1.8
    • generic
    • generic
    • Verified



      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)
      ======================================================================

            mfishersunw Maydene Fisher (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: