Getting first weekday in a month with strtotime

前端 未结 6 1435
情深已故
情深已故 2020-12-03 21:52

I\'m trying to figure out the first wednesday of a given month using strtotime, but the \"first wednesday\" argument fails whenever the first wednesday happens

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 22:09

    I believe it's the order in which you are placing values. When you write "December 2010", it already is going to 12/01/2010. When adding "first {day}", function goes for that very first day, after the 12/01/2010. I think if you declare the "first {day}" value and then "december 2010" it should work fine.

提交回复
热议问题