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

Truncating Duration

    XMLWordPrintable

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

      Description

      Classes like `LocalTime` and `Instant` have a method `truncatedTo(TemporalUnit unit)` that returns an instance with smaller units set to zero. A similar method should be added to `Duration`. Without this method, the user is forced to perform maths on the epoch-second or nano-of-second value, which is what java.time seeks to avoid.

      The specification and implementation would be very similar to that on `Instant`.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: