Forums Register Login

Calendar roll() method

+Pie Number of slices to send: Send
I recently downloaded a Date Picker control that has the strange behavior of going from Dec. 2003 (for example) to Jan. 2003 when I choose the 'next month' button ('>'). Researching the problem I discovered that this occurs because the author chose to use the Calendar roll() method, rather than the add() method. Studying the Javadocs for roll() I can't help but wonder what is the value of this method? Why would anyone ever want to use roll()?
It appears to me that this method might occasionally give the correct values, but would very often give incorrect results. So, can anyone explain to me when they would truly want to use the roll() method?
TIA,
Dave Derry
bacon. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1182 times.
Similar Threads
[help] any code to convert YYYYMMDD to Julian Date?
how to use java.util.Calendar in S2
Why I get a blank page?
public abstract class Calendar
help understanding Calendar constructor vs method
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:42:26.