-6

私のPHPファイルでは、日付は次の形式になっています: "2012-10-09 00:00:00"; 「10月9日」または「10月9日」(年を除く)として表示する必要があります。

どうすればこれを達成できますか?

4

2 に答える 2

4

これを試して:

echo date("M, d", strtotime($from));
于 2013-06-03T06:47:26.917 に答える
3
<?php
$from= "2012-10-09 00:00:00"
echo date('F n Y, strtotime($from)); // n-day, F- full month name, Y-Year 
?>

Please check this link for reference: http://php.net/manual/en/function.date.php You can skip 'Y' above to remove year from output.

于 2013-06-03T06:46:39.097 に答える