How to detect if today or tomorrow is the 2nd or last Wed of the month i开发者_Python百科n Java ? Any sample code ?
Use Joda Time Library, which has DateTime class and all the utility methods needed like plusDays(int),plusWeeks(int)
You having a problem with street-cleaning?
Calendar will tell you if it's a Wednesday (day.get(DAY_OF_WEEK) == WEDNESDAY
) and the day of the month. If it's a Wednesday between the 8th and 15th, it's the second of the month; between 22nd and the 29th, it's the fourth.
精彩评论