I've to convert string to date time. I'm doing the following:
$ndate= date("m-d-Y", strtotime($oDate))." ".date("H:i:s", strtotime($oTime));
$dated = date("Y-m-d H:i:s", strtotime($ndate));
First I have converted the posted date and time from string to datetime.
Then I have changed it's format for mySQL.
All this is working perfect on one of my page, but not working on the second one, and returns the date 01-01-1970.
I've checked in detail, but was unable to understand. Can there be alternative for it. I have to get date and time separately from the input form.