Ok, I need to allow the user to enter the date as 3/7/2004. Once they click submit, it need to convert it to a php timestamp. But I can't get my code to convert it.
$current_date = "3/7/2004"; // This value will be entered from user.
$current_date = strtotime(date("m/d/Y"));
echo $current_date; // this should show me that date value as a timestamp
echo"<br>";
$new_date = date('m-d-Y', $current_date); // to test it, I wanted to convert that timestamp back to a human readable date.
echo $new_date; // I echo the new date... it does not match the $current_date entered above
Here is the printed result:
1078722000
03-08-2004
The date is wrong, it should read 03-07-2004, why does it not match up??? Really need help with this please. I can't get it for some reason. Also, when entered in to the db, the table row is this: date bigint(20) NOT NULL, which works great for what I need.