PHP convert datetime to seconds

前端 未结 4 1713
南方客
南方客 2020-12-18 21:31

I have a datetime value in mysql \'2010-12-08 16:12:12\'
that I\'d like to get the seconds to that date using PHP,
so basically a PHP

4条回答
  •  臣服心动
    2020-12-18 21:39

    format('U') - $now->format('U');
    

    ->format('U') turns it into a unix timestamp.

提交回复
热议问题