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()
?
EDIT 1
Joda answers are not accepted!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…