Datetime To Unix timestamp

前端 未结 6 1627
长发绾君心
长发绾君心 2020-12-10 12:22

Is there anyone sitting on a PHP function to convert a date of format 0000-00-00 00:00:00(datetimesql) to unix timestamp?

6条回答
  •  我在风中等你
    2020-12-10 13:05

    Use strptime() to parse the time and turn it into a structured array.

    Then pass the results of that into the mktime() function to get a UNIX timestamp.

提交回复
热议问题