mysql - Format php datetime as "Wednesday, April 16, 2014 at 2:24 PM"
I have this this datetime stored in db: 2014-04-16 14:24:24
I'd like to format it to: Wednesday, April 16, 2014 at 2:24 PM
with this script: date("l, F d, Y \a\t g:i A", strtotime($list['publish_time']))
But it comes out as: Wednesday, April 16, 2014 a 2:24 PM
It seems the "t" in "at" is not escaping properly. Am I doing anything wrong? Please help, thanks in advance!!
Answer
Solution:
You need to use single quotes:
\t
in double-quotes (date("\t")
) is first parsed as tab character, thus the actual letter is missing.