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

add toEpochSecond methods for efficient access

    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:
      b100

      Description

      To efficiently get an epochSecond value:

      - add 'toEpochSecond(ZoneOffset) ' methods to 'LocalDate' and 'LocalTime'.
      - add 'toEpochSecond() ' method to 'OffsetTime'.

      The method on 'LocalDate' would be defined to set the time part to midnight (safe as ZoneOffset, not ZoneId)
      The methods on the time classes would be defined to set the date part to 1970-01-01.

        Issue Links

          Activity

          Hide
          scolebourne Stephen Colebourne added a comment -
          The method name would be `toEpochSecond()` to match that on `LocalDateTime`. (The singular is used for all temporal fields, the plural is used for all temporal units. Since epoch-scond is a field, it is singular).
          Show
          scolebourne Stephen Colebourne added a comment - The method name would be `toEpochSecond()` to match that on `LocalDateTime`. (The singular is used for all temporal fields, the plural is used for all temporal units. Since epoch-scond is a field, it is singular).
          Hide
          rriggs Roger Riggs added a comment -
          Epoch seconds are UTC, so the offset argument is present to shift the reference point from 'local' to UTC time.
          Show
          rriggs Roger Riggs added a comment - Epoch seconds are UTC, so the offset argument is present to shift the reference point from 'local' to UTC time.
          Show
          ntv Nadeesh Tv added a comment - http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-December/037717.html
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/d0a642db657b
          User: rriggs
          Date: 2015-12-23 18:53:10 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/d0a642db657b User: rriggs Date: 2015-12-23 18:53:10 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/d0a642db657b
          User: lana
          Date: 2016-01-06 20:14:31 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/d0a642db657b User: lana Date: 2016-01-06 20:14:31 +0000

            People

            • Assignee:
              ntv Nadeesh Tv
              Reporter:
              rriggs Roger Riggs
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: