PHP Date - How to add a string to separate date and time

后端 未结 5 1197
我寻月下人不归
我寻月下人不归 2021-01-13 01:19

I want to display date and time format something like this \"May 23 at 12:30pm\". I saw in PHP manual and found:

// Prints something like: Monda         


        
5条回答
  •  离开以前
    2021-01-13 01:47

    you need to escape the a and t as both have special meaning when used as formatting options in date()

    echo date('M j \a\t h:i a');
    

    See it in action

提交回复
热议问题