String date current date/time?

后端 未结 6 1548
北恋
北恋 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:10

    With regards to:

    $today = strtotime($date); 
    

    Those numbers are the current timestamp (the number of seconds since January 1st 1970). You can use this as a second parameter in the date function to change the date to whatever you want.

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

提交回复
热议问题