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

java.time LocalDate and LocalTime ofInstant() factory methods

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 9
    • 9
    • core-libs
    • 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.

      Attachments

        Activity

          People

            ntv Nadeesh Tv
            scolebourne Stephen Colebourne
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: