简体   繁体   English

检查日期是在工作日还是周末?

[英]Checking if date falls on weekday or weekend?

如何检查美国格式的日期(例如2012-01-01)是否属于工作日或周末的PHP?

$weekday = date("w", strtotime("2012-01-01"));

This will be 0 for Sunday through 6, Saturday. 星期六到星期六,这个数字是0。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM