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

Example in the Documentation is wrong for java.time.ZonedDateTime.minusHours

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 9
    • 8u60, 9
    • core-libs
    • b106

    Description

      A DESCRIPTION OF THE REQUEST :
      The java doc for
      public ZonedDateTime minusHours(long hours)
      ...
         * For example, consider a time-zone where the spring DST cutover means that the
           * local times 01:00 to 01:59 occur twice changing from offset +02:00 to +01:00.
           * <ul>
           * <li>Subtracting one hour from 02:30+01:00 will result in 01:30+02:00
           * <li>Subtracting one hour from 01:30+01:00 will result in 01:30+02:00
           * <li>Subtracting one hour from 01:30+02:00 will result in 00:30+01:00
           * <li>Subtracting three hours from 02:30+01:00 will result in 00:30+02:00
      ...
      the first example is wrong. It should read
           * <li>Subtracting one hour from 02:30+01:00 will result in 01:30+01:00

      JUSTIFICATION :
      Wrong documentation


      Attachments

        Activity

          People

            rriggs Roger Riggs
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: