This is the pseudo code, I get a date from the user and convert it to Unix timestamp
$unix_DOB = UnixTimeFromDateString($POST['DOB_Day'],$POST['DOB_Month'],$POST['DOB_Year']);
This is the function UnixTimeFromDateString
function UnixTimeFromDateString($day,$month,$year) {
$unixtime = mktime(0,0,0,$month,$day,$year);
return $unixtime;
}
This is then stored in a mySQL database table.
When I retrieve the record I then do
$dayToSelect = date("d",$selectedUnixDate);
$monthToSelect = date("m",$selectedUnixDate);
$yearToSelect = date("Y",$selectedUnixDate);
This is performed this way because I am populating a list box and use the ToSelect variable to select that component in the list box.
The problem is that after doing the conversion back to day month year I do not get the same date that was entered, for example,
02/02/1990 gets stored as 633747600, when retrieved and reformatted it is now 31/01/1990.
Any ideas or assistance would be greatly appreciated.