You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/07/04 23:20:10 UTC
DO NOT REPLY [Bug 25560] -
DateUtils.truncate() is off by one hour when using a date in DST switch 'zone'
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=25560>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=25560
DateUtils.truncate() is off by one hour when using a date in DST switch 'zone'
------- Additional Comments From stevencaswell@apache.org 2004-07-04 21:20 -------
The appears to be fixable with a minor change to the DateUtils.modify method,
replacing the val.add call with a val.set call, doing the calculation external
to the Calendar instance. For some reason, the Calendar.add method subtracts an
additional hour in the particular test scenario mentioned in the bug report, but
doesn't with other timezones I tested (such as US/Eastern). So I think the
easiest fix is to do the calculation in our code.
I have changed the DateUtils.modify method and the existing tests pass. I've
written one test to verify the fix works with the above scenario, and I plan to
write some additional tests for rounding.
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org