learningPHP1 Posted April 3, 2014 Share Posted April 3, 2014 hello,Trying to convert 2 post variables to strtotime so that it can be saved to a database.The 2 variables are:$testDate = $_POST['date'] ; // containts: 2014-04-22$testTime = $_POST['time']; // containt: 21:02:17echo $date_time = $testDate . $testTime; // result: 6969-1212-3131 19:00:00echo $new_date = date('yy-mm-dd H:i:s', strtotime($date_time)); // result: 6969-1212-3131 19:00:00how do i go about setting the $new_date variable to 2014-04-22 21:02:17 so that it can be saved to a database(mysql data type: datetime)any help you can provide would be greatly appreciated.Thanks Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.