Mysql
 sql >> Database >  >> RDS >> Mysql

PHP converte datetime in secondi

<?php

$date1 = new DateTime("2010-12-08 16:12:12");
$now = new DateTime();

$difference_in_seconds = $date1->format('U') - $now->format('U');

->format('U') lo trasforma in un timestamp Unix.