leading 0 in month parameter making wrong output

前端 未结 2 1114
萌比男神i
萌比男神i 2020-12-22 06:37

Why the leading zero in the month parameter making wrong output?

echo date(\"Y-m-d\", mktime(0, 0, 0, 09, 23, 2013));//output 2012-12-23
echo date(\"Y-m-d\",         


        
2条回答
  •  醉酒成梦
    2020-12-22 07:40

    We can make this parameter as a string and it will work.

    Try this:

    echo date("Y-m-d", mktime(0, 0, 0, '09', 23, 2013));//output 2012-12-23
    

提交回复
热议问题