【问题标题】:Checking if date falls on weekday or weekend?检查日期是在工作日还是周末?
【发布时间】:2012-03-04 09:17:42
【问题描述】:

如何检查美国格式的日期,例如2012-01-01 PHP 是在工作日还是周末?

【问题讨论】:

标签: php


【解决方案1】:
$weekday = date("w", strtotime("2012-01-01"));

从星期日到星期六,这将是 0。

http://www.php.net/manual/en/function.strtotime.php

http://php.net/manual/en/function.date.php

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-09
    • 1970-01-01
    • 1970-01-01
    • 2021-08-11
    • 1970-01-01
    • 2015-06-05
    相关资源
    最近更新 更多