Horst Walter Horst Walter - 4 months ago 12
MySQL Question

Convert mysql DB timestamp to int time for PHP touch

I have a mysql timestamp which looks like this:

2016-08-31 21:54:33
. I need to use this timestamp in PHP touch:
bool touch ( string $filename [, int $time = time() [, int $atime ]] )

How can I best convert into the
value needed in


In an object oriented syle:

$dateTime = new DateTime("2016-08-31 21:54:33");
echo $dateTime->getTimestamp();