Month by week of the year?

前端 未结 4 493
感动是毒
感动是毒 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 22:42

    Just wanted to add a note for the first answer, the week number should be 01-09 for Weeks 1 through 9 (it will always give month 1 if you don't add the leading zero)

    date("m",strtotime("2011-W06-1"));
    

提交回复
热议问题