dqwh0109 2009-09-09 09:21
浏览 18
已采纳

如何在CakePHP中更改时间戳的格式?

In my application,I retrieve a timestamp from the table which is of the format 2009-08-18 12:09:01. I need to change this to August 18th,2009 or 18 Aug,2009. How to achieve this in CakePHP?

Are there any built in methods?

  • 写回答

4条回答 默认 最新

  • dousi4148 2009-09-09 09:23
    关注

    You can use strptime to parse the string into a datetime and then strftime to format it back into the string you want.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?