Getting first weekday in a month with strtotime

前端 未结 6 1438
情深已故
情深已故 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:10

    I found this note in the PHP manual.

    "In PHP 5 prior to 5.2.7, requesting a given occurrence of a given weekday in a month where that weekday was the first day of the month would incorrectly add one week to the returned timestamp. This has been corrected in 5.2.7 and later versions."

提交回复
热议问题