java - to get the start date and end date of each week for the given month

前端 未结 3 590
暗喜
暗喜 2021-01-06 12:03

Following is the code that I am using to calculate the week start date and end date for the given month. Assume week start day is MONDAY and week end day is SUNDAY. For exa

3条回答
  •  广开言路
    2021-01-06 12:20

    A possible solution may be to not reinvent the wheel and use JodaTime or a similar library. For instance, you can use the dayOfWeek() function on a DateTime to get the information you're after.

提交回复
热议问题