I have times stored in the database in this format
09:30:00
And of course I can display them on the page in that format. But how do I display it in the following format?..
9.30am
I have looked for a solution but can't find anything that does just this.
答案 0 :(得分:1)
使用date()函数转换时间格式。
$time = date("g:ia", strtotime("09:30:00"));
细分时间格式:
请参阅manual。
答案 1 :(得分:1)
试试这个,
$timeval = date("g:i a", strtotime("09:30:00"));