Does PHP have an inverse of the date() function (other than strtotime())?

前端 未结 7 631
别跟我提以往
别跟我提以往 2021-01-17 14:53

Is there a function that uses the date() format to interpret a string?

echo date(\'s-i-H d:m:Y\', 1304591364); // 34-29-17 05:05:2011

// Does t         


        
7条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-17 15:14

    The function mktime seems to do what you want.

    Check the help over at php.net:

    http://php.net/manual/en/function.mktime.php

    EDIT : indeed strtotime may be more convenient for you, I did not know that function, glad to learn.

提交回复
热议问题