Heim > Fragen und Antworten > Hauptteil
PHP中文网2017-04-10 17:06:37
你看这样行吗?希望对你有帮助
$str = "Tue Mar 22 2016 15:07:48 GMT+0800 (中国标准时间)";
$arr = explode("GMT+0800", $str);
$time = strtotime($arr[0]);
echo date("Y-m-d H:i:s", $time);
黄舟2017-04-10 17:06:37
html5 input type=month 的表示形式是YYYY-MM
,你这里的格式确认是month?
https://www.w3.org/TR/html-markup/input.month.html
http://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_month