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

java.util.Date constructor rejects valid year values

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      1.1
    • CPU:
      sparc
    • OS:
      solaris_2.5
    • Verification:
      Not verified

      Description


      The year 1963 is rejected as invalid ; see test code below:


      import java.sql.*;

      class DateTest {

          public static void main (String args[]) {

      java.util.Date date;

      date = new java.util.Date(63, 4, 13);

      java.lang.System.out.println("Date: " + date);

      }
      }

      java DateTest
      java.lang.IllegalArgumentException: year out of range.
      at java.util.Date.<init>(Date.java)
      at java.util.Date.<init>(Date.java)
      at DateTest.main(DateTest.java:9)

      Compilation finished at Tue Apr 16 14:08:55

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              duke J. Duke (Inactive)
              Reporter:
              mhapnersunw Mark Hapner (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: