php - 错误的文本/数字日

时间:2014-10-31 23:05:39

标签: php date

$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日也是星期六。怎么了?

1 个答案:

答案 0 :(得分:1)

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