Here's my code:
echo $startdate1 = $_POST['registration_opens_date'];
echo $enddate1 = $_POST['registration_ends_date'];
How to convert date format from January 1, 2014 11:15 PM
to 2014-01-01 23:15:00
.
Here's my code:
echo $startdate1 = $_POST['registration_opens_date'];
echo $enddate1 = $_POST['registration_ends_date'];
How to convert date format from January 1, 2014 11:15 PM
to 2014-01-01 23:15:00
.
try this
echo date('Y-m-d H:i:s',strtotime($_POST['registration_opens_date']));
echo date('Y-m-d H:i:s',strtotime($_POST['registration_ends_date']));
Try this:
echo date_format(date_create($startdate1), 'Y-m-d H:i:s');
Here is an exemple of what you want
<?php
echo $test="January 1, 2014 11:15";
$test= date_create($test);
echo "<br>";
echo date_format($test,'Y-m-d h:i:s');
?>