如果您正在使用MySQL,那么我建议您使用MySQL date_format()函数,如下所示:
SELECT date_format(date, '%b %e,%Y') AS `formatted_date` FROM `table_name`;
Run Code Online (Sandbox Code Playgroud)
在PHP中,您可以使用strtotime,或者在MySQL中,您可以使用UNIX_TIMESTAMP将日期转换为时间戳.
然后,您可以使用日期函数根据需要对其进行格式化:
$timestamp = strtotime($myDate);
$dateStr = date('M j, Y', $timestamp);
Run Code Online (Sandbox Code Playgroud)