Here’s how:
/**
* convert a datetime value (Y-m-d H:i:s) to UNIX timestamp value
* @param datetime $datetime
* @return timestamp
*/
function datetime_to_timestamp($datetime) {
list($date, $time) = explode(" ", $datetime);
list($year, $month, $day) = explode("-", $date);
list($hour, $minute, $second) = explode(":", $time);
return mktime($hour, $minute, $second, $month, $day, $year);
}