ぶろぐ

日記です

timestampの整形


MySQL側でやらせちゃう場合は、以下でいける。

select 
    DATE_FORMAT(created, '%Y年%m月%d日') as created
    -- 時間まで入れるとき
    -- DATE_FORMAT(created, '%Y年%m月%d日 %H時%i分%s秒')
from
    hoge;