更新时间:2022-06-05 22:35:14
首先使用 createFromFormat
方法,提供输入格式:
Use createFromFormat
method first, provide the input format:
$exd = DateTime::createFromFormat('d M, Y', '01 Dec, 2015');
// arguments (<format of the input>, <the input itself>)
$exd = date_format($exd, 'Y-m-d'); // then choose whatever format you like
echo $exd;