commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maxi (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LANG-59) [lang] DateUtils.truncate method is buggy when dealing with DST switching hours
Date Thu, 21 Oct 2010 02:31:43 GMT

    [ https://issues.apache.org/jira/browse/LANG-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12923289#action_12923289
] 

Maxi commented on LANG-59:
--------------------------

The problem persist in both versions: 2.4 and 2.5


DateUtils.trucate() does not work properly with daylight saving time.
e.g.:
Date: 2010/10/10 05:16:14.0

DateUtils.truncate(date, Calendar.DATE) : Sun Oct 10 01:00:00 CLST 2010

Instead of showing 10/10/2010, it shows 10/10/2010 01:00:00


> [lang] DateUtils.truncate method is buggy when dealing with DST switching hours
> -------------------------------------------------------------------------------
>
>                 Key: LANG-59
>                 URL: https://issues.apache.org/jira/browse/LANG-59
>             Project: Commons Lang
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: Operating System: Windows XP
> Platform: Other
>            Reporter: Li Zhang
>             Fix For: 2.2
>
>         Attachments: lang_issue_59.txt
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message