Formatting the date with a custom attribute
Permalink
Hello. I've got a news template that includes attributes for fields such as Author, Publication and Date.
In my template for the news page, I've hard-coded these fields:
This works very nicely, except it formats the date like so:
yyyy-mm-dd hh:mm:ss
Is there a ways to specify a different formatting?
Thanks
In my template for the news page, I've hard-coded these fields:
This works very nicely, except it formats the date like so:
yyyy-mm-dd hh:mm:ss
Is there a ways to specify a different formatting?
Thanks
Thanks for the quick response. This bit of code gives me a syntax error, unexpected ';', though as far as I can tell, it certainly looks correct. Any idea what might be causing that?
I forget an extra ) at the end of the first line. I edited it to reflect the correction.
Oh algebra, you win again!
Thanks. It works like a charm.
Thanks. It works like a charm.
Thank you, you just ended hours of searching.
Using this method, you could format it however you want in the date function. Seehttp://php.net/manual/en/function.date.php...