Month by week of the year?

前端 未结 4 546
感动是毒
感动是毒 2021-01-22 22:30

I\'m trying to get the number of the month of the year by the number of a week of the year and the year. So for example week 1 is in january and returns 1, week 6 is in february

4条回答
  •  误落风尘
    2021-01-22 23:04

    print date("m",strtotime("2011-W6-1"));
    

    (noting that in 2011, January has six weeks so week 6 (by some definitions) is in month 1).

提交回复
热议问题