To generate a DateTime object from any format, use the DateTime::createFromFormat method. The timestamp may then be obtained using that object (or the date can be formatted in another way):
// $_POST['date'] = '2013/11/22';
// $_POST['time'] = '10:10 AM';
$datetime = $_POST['date'] . ' ' . $_POST['time'];
$datetime = DateTime::createFromFormat('Y/m/d h:i A', $datetime);
if ($datetime) {
$timestamp = $datetime->getTimestamp();
} else {
echo 'Invalid date or time.';
}
All elements of the input should have leading zeros according to the format in my solution (Y/m/d h: I A) (e.g., 2013-01-01 01:01 AM). You will need to modify the input format if the input doesn't utilize leading zeros. The manual lists all the supported format characters.