gpt4 book ai didi

php - 如何在 PHP 中找到当月的最后一个星期六是哪一天?

转载 作者:行者123 更新时间:2023-12-01 07:16:07 24 4
gpt4 key购买 nike

这适用于大多数月份,但例如,2011 年 4 月有 5 个星期六,因此返回 23 而不是 30。

$last_saturday = date("j", strtotime('Fourth Saturday'.date('F o')));

最佳答案

有趣的是,strtotime("last saturday of this month")正是这样做的。

Supported Date and Time Formats更多信息,特别是关于 Relative Formats 的部分.

关于php - 如何在 PHP 中找到当月的最后一个星期六是哪一天?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5767561/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com