String date current date/time?

后端 未结 6 1530
北恋
北恋 2021-02-19 00:51

I am using $date = date(\"D M d, Y G:i\");.

When I echo $date, it shows the correct date/time. Now I need this as an string.

I have tr

6条回答
  •  终归单人心
    2021-02-19 01:00

    The date() function already returns a string.

    Doing this :

    $date = date("D M d, Y G:i");
    

    You'll have the current date in the $date variable, as a string -- no need for any additional operation.

提交回复
热议问题