What would be a good implementation to get all Monday and Thursday dates Between a given date range (DateX and DateY) in JAVA

后端 未结 3 684
执笔经年
执笔经年 2021-01-21 09:28

I want to get some days between a given range of dates. What would be an optimal solution for this? For example, I want to get all Monday, Wednesday and Thursday dates from toda

3条回答
  •  温柔的废话
    2021-01-21 09:56

    Have a look at java.util.Calendar. One can get a instance of it, set it to a given date, then, for example, call get(DAY_OF_WEEK) on it. Also it has some nice methods to get number of day in a given year and number of days in a given year.

提交回复
热议问题