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:
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.
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.
same problem here.... :{