[ 
http://issues.apache.org/jira/browse/LANG-59?page=comments#action_12419168 ] 

Li Zhang commented on LANG-59:
------------------------------

Forget my previous post. The fix is broken. The problem is sometimes when you 
call Calendar.set method the DST_OFFSET field is reset to 0.

> [lang] DateUtils.truncate method is buggy when dealing with DST switching 
> hours
> -------------------------------------------------------------------------------
>
>          Key: LANG-59
>          URL: http://issues.apache.org/jira/browse/LANG-59
>      Project: Commons Lang
>         Type: Bug

>     Versions: 2.1
>  Environment: Operating System: Windows XP
> Platform: Other
>     Reporter: Li Zhang
>      Fix For: 2.2

>
> 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);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to