【发布时间】:2014-02-18 04:19:25
【问题描述】:
我从数据库中获取数据,它以2014-01-06 06:13:06 之类的格式为我提供日期。我想将此日期转换为Jan 6th 2014 格式。
这是我的代码:
<?php
$query="SELECT Min(transaction_date) as start,Max(transaction_date) as end from transactions";
$result1= mysql_query($query) or die(mysql_error());
$ors1=mysql_fetch_array($result1);
$date= $ors1['start'];
echo date_format($date, 'g:ia \o\n l jS F Y');
?>
【问题讨论】:
-
echo date( 'g:ia \o\n l jS F Y', strtotime($ors1['start']))