The following code is the output into a table where I have a list of dates which are also hyperlinks to an event on that date. It currently displays YMD and I would like it to display DMY.
I have tried using ‘dateFormat’=>’DMY’ in the array but this does not change anything.
Html->link($shiftsession[‘Shiftsession’][‘sessionDate’], array(
‘controller’ => ‘shiftsessions’,
‘action’ => ‘view’,
$shiftsession[‘Shiftsession’][‘SessionID’])); ?>
http://book.cakephp.org/1.2/view/203/options-dateFormat
If anyone could shed some light on how you properly use dateFormat I’d be stoked.
Good ole’ PHP date() to the rescue:
(Obviously you could write that whole thing into one line… for example purposes on StackOverflow, it reads better like this imo)
With CakePHP:
CakePHP has a nice Time Helper, but it doesn’t have an option to specify exactly what format you’d like. Instead, it has things like
gmt(), andniceShort(), andtimeAgo()…etc