Way to present date in different format

Permalink
Hi,

I'm wondering if there is a way to take the standard date and time output by a custom Page Attribute I've added to one of my page types (YYYY-MM-DD HH:MM:ss) and change it to display something like DD June YYYY at HH:MM:SS, basically rearranging the date ordering and changing the month number to the relevant word?

This is the code I'm using in my page type template to display the date/time:
<?php $date = $c->getAttribute('date'); print '<p>' . $date . '</p>'; ?>


Is there a better way of doing this, perhaps by using different code?

Or will I need to write a little routine to parse the $date variable and extract/alter it as necessary?

Many thanks for all help and advice,
Tony.

 
danielboccato replied on at Permalink Reply
any pointers?
same problem here.... :{
Mnkras replied on at Permalink Best Answer Reply
Mnkras
something like

echo date_format($date, 'd-F-Y H:i:s');
danielboccato replied on at Permalink Reply
thanks