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

Update date/time classes in j.util and j.sql packages to interoperate with new JSR310 date/time classes

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P3
    • 8
    • None
    • core-libs
    • None
    • b78
    • Verified

    Description

      Following methods are proposed to add into existing jdk date/time classes in j.util and j.sql packages to interoperate with the JSR310 date/time types.

      java.util.Date
          public static Date from(Instant instant)
          public Instant toInstant()
      java.util.Calendar
          public final Instant toInstant()
      java.util.GregoricanCalendar
          public ZonedDateTime toZonedDateTime()
          public static GregorianCalendar from(ZonedDateTime zdt)
      java.util.TimeZone
          public static TimeZone getTimeZone(ZoneId zoneid)
      java.sql.Date
          public static Date valueOf(LocalDate date)
          public LocalDate toLocalDate()
          public Instant toInstant()
      java.sql.Time
          public static Time valueOf(LocalTime time)
          public LocalTime toLocalTime()
          public Instant toInstant()
      java.sql.Timestamp
          public static Timestamp valueOf(LocalDateTime dateTime)
          public LocalDateTime toLocalDateTime()
          public static Timestamp from(Instant instant)
          public Instant toInstant()

      Attachments

        Activity

          People

            sherman Xueming Shen
            sherman Xueming Shen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: