Is there anyone sitting on a PHP function to convert a date of format 0000-00-00 00:00:00(datetimesql) to unix timestamp?
To do this in PHP 5.2 you can do this:
$datetime = new DateTime(); echo $datetime->format('U');
A newer way to do this as of PHP 5.3 is:
$datetime = new DateTime(); echo $datetime->getTimestamp();
2.1m questions
2.1m answers
60 comments
57.0k users