I have a working php file, which use lots of custom dates.
I am try to simply format an echoed out put, with no success(very new to php).
hope someone can help.
$rotaDate = date('23/2/14');$driverListDate = date('5/1/14');
//Calculate the differance between 2 dates function dateDiffInWeeks($date1, $date2,$noOfLines){ $first = DateTime::createFromFormat('d/m/Y', $date1); $second = DateTime::createFromFormat('d/m/Y', $date2); return (((floor($first->diff($second)->days/7))/$noOfLines) - floor((floor($first->diff($second)->days/7))/$noOfLines))*$noOfLines; }
function customData($con,$num,$driverListDate,$rotaDate,$noOfLines,$line){ if($line==getNewLine($con,$num,$driverListDate,$rotaDate,$noOfLines)) { //echo date("jS F Y" ); //echo date('jS F Y', $rotaDate); return $rotaDate; } }
Im trying to echo my date as "jS F Y" format.
This of course is not my full php file, but im sure its all thats relevant.
Thanks in advance!