我尝试使用date("F j, Y \a\t h:i a", strtotime($date));
但这会产生May 20, 2013 a 04:37 pm
我还尝试了date("F j, Y \at\ h:i a", strtotime($date));
和
date("F j, Y \a\t\ h:i a", strtotime($date));
它变成了May 20, 2013 a31 04:37 pm
我想要制作的是May 20, 2013 at 04:37 pm
谢谢!
答案 0 :(得分:5)
双引号\t
将被解释为制表符。使用单引号(或双斜线)可以解决问题:
echo date('F j, Y \a\t h:i a', strtotime('2013-05-20 23:59:59'));
// output: May 20, 2013 at 11:59 pm