I know this can be done but I am lost. I have read the manual and searched the forums for hours now. I have looked at strftime and getdate. I thought about breaking the date into an array and then redisplaying it but that seemed impossible to figure out.
Is there a quick and simple way to take the date that is in the database (stored: YYYY-DD-MM) and in the results make it display as MM-DD-YYYY?
I am trying to write a function that will take all of the dates in the database and when the results are shown in the above format.
I don't know if this will help but here is the function.
//Display Date in MM-DD-YYYY from YYYY-DD-MM
function displayDate($Date)
{
$sql = "SELECT * FROM $this->$interred, $this->$trans, $this->$request, $this->$history WHERE
$interred.IntermentDate = '$DateInt' AND
$interred.DOD = '$death' AND
$interred.DOB = '$birth' AND
$interred.ServiceDate = '$service' AND
$request.ReqDate = '$DateReq' AND
$trans.InitDate = '$InitDate' AND
$trans.CancelDate = '$cancel' ";
echo $sql."<br>\n";
$result = @mysql_query($sql, $this->cnx) or die("Couldn't execute query.");
if ($row = mysql_fetch_array($result)) {
$dateInt= $row['IntermentDate'];
$dateDeath= $row['DOD'];
$dateBirth= $row['DOB'];
$dateService= $row['ServiceDate'];
$dateDateReq= $row['ReqDate'];
$dateInitDate= $row['InitDate'];
$dateCancelDate= $row['CancelDate'];
return $Date;
}
return "";
}
}
Any help is appreciated