2012-03-08 9 views
-1

가능한 중복 : 쇼를 실행 내에서 print_r 함수 내부
Date formatting in PHP날짜를 포맷

$ 메시지 -> date_sent이 같은 2012-03-05 0시 0분 0초

echo '<td>'.date('F d, Y', $message->date_sent).'</td>'; 

날짜 기능은 내가 2012 년 3 월 5 일로 설정하기를 원하기 때문에 여기에서 원하는 기능이 아닙니다.

+0

당신은'date ('F d, Y', st 'date()'는 유닉스 타임 스탬프를 취하고 날짜는 MySQL처럼 보입니다. DATETIME –

+0

이미 http://stackoverflow.com/questions/9525867/change-format-에서 답을 얻었 기 때문에 rtotime ($ message-> date_sent) 또한 facebook-end-time/And also here http://stackoverflow.com/questions/2009296/date-formatting-in-php – bretterer

+0

묻지 않기 전에 검색하십시오 ** 동일한 ** 중복은 아니지만 동일한지면은 덮여 같은 결과로 이어지는'strtotime()'사용 –

답변

2

월 의 짧은 표기 월 의 긴 표기 날짜의 두 번째 인수

echo '<td>'.date('F d, Y', strtotime($message->date_sent)).'</td>';

0

에 전화 strtotime 2012년 1월 12일

<?php echo '<td>'.date("F d Y", strtotime($message->date_sent)) .'</td>'; ?> 

2012년 1월 12일

<?php echo '<td>'.date("M d Y", strtotime($message->date_sent)) .'</td>'; ?>