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

RFE: need way to set the date of a calendar without a Date object

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.1.8, 1.2.0, 1.2.1, 1.2.2
    • core-libs
    • beta
    • generic, x86
    • generic, windows_nt



      Name: sg39081 Date: 06/03/99


      Calendar has public methods:

        Date getTime();
        setTime (Date);

      getTime () always returns a new Date made from an internal
      millisecond value, and setTime always gets the milliseconds
      out of the Date. Date is pretty much a useless class. There
      should be public methods:

        long getTimeInMillis ();
        setTimeInMillis (long);

      which avoid the needless/useless Date object. The salt in the
      wound on the matter is that there are in fact *protected*
      getTimeInMillis() and setTimeInMillis() methods, which seem
      to be just fine. They ought to be made public.

      Dan Bornstein
      ###@###.###
      (Review ID: 83912)
      ======================================================================

      Name: tb29552 Date: 10/23/99


      I need to do Calendar calculations and then send the time from
      the epoch in Milliseconds over the network. I can set a
      Calendars time with milliseconds by creating a date and setting
      the calendar to that date but after doing the calculations I
      can't get the milliseconds back out, because the getTimeInMillis()
      is protected.
      (Review ID: 96942)
      ======================================================================

            okutsu Masayoshi Okutsu
            sgoodsunw Sheri Good (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: