Jump to content

Help with converting a date


refiking

Recommended Posts

OK.  So, I am getting a date with the date in m/d/y format and then the hour and the minute.  How can I convert this the correct way.  This is what I am currently trying:

 

$started =  date("Y-m-d H:i:s", strtotime($_POST['started'] . ' ' . $_POST['started_hour'] . ': ' . $_POST['started_min'])); 
echo $started;

 

It give me the standard "1969-12-31 17:00:00".  When all I tried was $_POST['started'], I at least got the date right.

Link to comment
https://forums.phpfreaks.com/topic/210668-help-with-converting-a-date/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.