错误的文本/数字星期几


wrong textual/numerical day of the week

$thedate = "2014-11-01 00:32";
echo $thedate; = 2014-11-01 00:32 = ok
$pd = date("Y-m-d", strtotime($thedate));
echo $pd; = 2014-11-01 = ok
$dow = date("l",$pd);/$dow = date("w",$pd);
echo $dow; = Wednesday/3 = not OK - 2014-11-01 is Saturday/6

我以为它放错了日期和月份,但 1 月 11 日也是星期六。怎么了?

您要将字符串 (2014-11-01 in $pd ( 作为第二个参数传递,而不是将时间戳传递给 date 函数