Calendar add() vs roll() when do we use it?

Posted by Pentium10 on Stack Overflow See other posts from Stack Overflow or by Pentium10
Published on 2010-03-23T22:41:47Z Indexed on 2010/03/23 22:43 UTC
Read the original article Hit count: 117

Filed under:
|

I know add() adds the specified (signed) amount of time to the given time field, based on the calendar's rules.

And roll() adds the specified (signed) single unit of time on the given time field without changing larger fields.

I can't think of an everyday usage of roll() I would do everything by add().

Can you help me out with examples when do we use roll() and when add()?

© Stack Overflow or respective owner

Related posts about java

Related posts about calendar