Suppose the following code is executed on the 22nd of August 2009 (a Saturday)
Calendar c = Calendar.getInstance();
c.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
c.get(Calendar.DAY_OF_MONTH)
will return 23. I'm interested in the conditions is would return 14 (last Sunday, rather than the next Sunday).
Are there any rules associated with the direction Calendar will roll the DAY_OF_MONTH/YEAR
when DAY_OF_WEEK
is set? If so what are they?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…