I have two inputs Time and Date. I want to convert these fields to one using php and insert them into a datetime field in mysql. I think I need to use a STR_TO_DATE. But I'm unsure how to do it. Thanks
Format
Time = 12:00 PM
Date = 2010-11-17
I have two inputs Time and Date. I want to convert these fields to one using php and insert them into a datetime field in mysql. I think I need to use a STR_TO_DATE. But I'm unsure how to do it. Thanks
Format
Time = 12:00 PM
Date = 2010-11-17
$Time = "12:00 PM";
$Date = "2010-11-17";
$DateTime = $Date . " " . $Time;
$timestamp = date('Y-m-d H:i:s',strtotime($DateTime));