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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1
    • 2.2
    • None
    • None
    • Operating System: Windows XP
      Platform: Other

    • 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

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

              Dates

                Created:
                Updated:
                Resolved: