Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-59

[lang] DateUtils.truncate method is buggy when dealing with DST switching hours

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: Other

    • Bugzilla Id:
      37243

      Description

      Try to truncate 2004-10-31 01:00:00 MDT by hour and you'll actually get 2004-10-
      31 01:00:00 MST, which is one hour after the input hour.

      // truncate 2004-10-31 01:00:00 MDT
      Date oct31_01MDT = new Date(1099206000000L);
      Date result = DateUtils.truncate(oct31_01MDT, Calendar.HOUR_OF_DAY);
      assertEquals(oct31_01MDT, result);

        Attachments

        1. lang_issue_59.txt
          6 kB
          Niall Pemberton

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                li.zhang@aeso.ca Li Zhang
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: