Forum Moderators: coopster
I think that implode thing should work. I read this [us4.php.net...] but need more help.
There are more details about my select boxes below.
$birthday = date("Y-m-d",(int)$_POST['byear'].'-'.(int)$_POST['bmonth'].'-'.(int)$_POST['bday']);
<select name="bmonth">
<option value="" selected>Month</option>
<option value=01>January</option>
<option value=02>February</option>
<select name="bday">
<option value="" selected>Day</option>
<option value=01>01</option>
<option value=02>02</option>
<select name="byear">
<option value=1890>1890</option>
<option value=1891>1891</option>
<option value=1892>1892</option>
What can I do?
$convert = strtotime("2004-01-04");
$settime = $convert;
echo "settime: " . $settime . "<br />";
echo "formatted: " . date("F j, Y, g:i a",$settime) . "<p />";
if your function returns a date in 1969 then it almost always means bad timestamp
the real way to do what you are trying to do would be
$birthday = date("Y-m-d",mktime(0,0,0,$_POST['bmonth'],$_POST['bday'],$_POST['byear']));
using mktime to convert the data you get from the form/user to create a timestamp and then pass that into date to get the appropriate format.