我從數據庫中獲取數據,它給了我一個像2014-01-06 06:13:06
這樣的格式的日期。我想將此日期轉換爲格式Jan 6th 2014
。如何在PHP中轉換dateformat?
這裏是我的代碼:
<?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']))' – softsdev