Get week of month with Joda-Time

前端 未结 4 428
半阙折子戏
半阙折子戏 2021-01-12 20:00

Is it possible to parse a date and extract the week of month using Joda-Time. I know it is possible to do it for the week of year but I cannot find how/if it is possible to

4条回答
  •  有刺的猬
    2021-01-12 20:46

    This option in Joda is probably nicer:

    Weeks.weeksBetween(date, date.withDayOfMonth(1)).getWeeks() + 1
    

提交回复
热议问题