String date current date/time?

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

    Your $date variable is a string, there's no need for any conversion.

    You can have a look at the documentation: http://ch.php.net/manual/en/function.date.php. The return value of the date() function is string.

    The strange numbers you see when you call strtotime() is the Unix timestamp which represents the number of seconds elapsed since January 1 1970 00:00:00 UTC.

提交回复
热议问题