Datetime To Unix timestamp

前端 未结 6 1628
长发绾君心
长发绾君心 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 12:50

    Another option as you have tagged this question with SQL: the MySQL functions FROM_UNIXTIME and UNIX_TIMESTAMP -> MySQL manual

    SELECT UNIX_TIMESTAMP(datetime_column) FROM table
    

    This usually is faster than a PHP function call.

提交回复
热议问题