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

java.time LocalDate and LocalTime ofInstant() factory methods

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b94

      Description

      External question sites indicate that users have difficulty converting between java.util.Date and LocalDate, and also between Instant and LocalDate/LocalTime. This user difficulty can be resolved with some additional methods.

      Currently, the following methods exist:

       ZonedDateTime.ofInstant(Instant, ZoneId);
       OffsetDateTime.ofInstant(Instant, ZoneId);
       LocalDateTime.ofInstant(Instant, ZoneId);
       OffsetTime.ofInstant(Instant, ZoneId);

      This enhancement proposes to add the same method to LocalDate and LocalTime. It can reasonably be argued this was a simple oversight in the original development.

        Activity

        Hide
        scolebourne Stephen Colebourne added a comment -
        Patch to implement feature with tests.
        Show
        scolebourne Stephen Colebourne added a comment - Patch to implement feature with tests.
        Show
        ntv Nadeesh Tv (Inactive) added a comment - - edited http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-November/036502.html
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/cfc458cf9c9c
        User: rriggs
        Date: 2015-11-16 20:34:09 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/cfc458cf9c9c User: rriggs Date: 2015-11-16 20:34:09 +0000
        Hide
        hgupdate HG Updates added a comment -
        URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/cfc458cf9c9c
        User: lana
        Date: 2015-11-25 21:18:22 +0000
        Show
        hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/cfc458cf9c9c User: lana Date: 2015-11-25 21:18:22 +0000

          People

          • Assignee:
            ntv Nadeesh Tv (Inactive)
            Reporter:
            scolebourne Stephen Colebourne
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: