如何在PHP中将M d, D
= Jan 17, Tue
转换为Y-m-d
= 2017-01-17
?
答案 0 :(得分:3)
试试这个:
echo date('Y-m-d',strtotime('Jan 17, Tue'));
答案 1 :(得分:3)
echo date('Y-m-d',strtotime('Jan 17, Tue'));
答案 2 :(得分:3)
$date = DateTime::createFromFormat('d/m/Y', "17/01/2017");
echo $date->format('Y-m-d');
来源 - http://www.php.net/manual/en/datetime.createfromformat.php
希望这会有所帮助......