Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Can the date be displayed like this?
Right now on my site (http://openswitch.org) I’ve got this code to display each article’s posted date:
<txp:posted format=”%m<br />%d<br />%y” />
And it results in the date looking like this:
07
30
07
I like that, but what I’d REALLY like to do is get my date to look like this:
0
7
3
0
0
7
I assume I can’t do this with straight-up strftime formatting but is there any way to write a php script or something that could get the date to look like this?
Ben Gray | ben@openswitch.org | http://openswitch.org
Offline
Re: Can the date be displayed like this?
Something like this perhaps:
<txp:php>echo nl2br(chunk_split(posted(array('format' => '%m%d%y')), 1, "\n"));</txp:php>
Last edited by ruud (2007-07-31 12:55:40)
Offline
Re: Can the date be displayed like this?
That doesn’t seem to work. The script looks good to me, but nothing displays when I put that snippet into my template.
Ben Gray | ben@openswitch.org | http://openswitch.org
Offline
Re: Can the date be displayed like this?
Oops. forgot the echo. Corrected in the code above.
Offline
Re: Can the date be displayed like this?
Genius! I owe you big time! Thanks a ton!
Ben Gray | ben@openswitch.org | http://openswitch.org
Offline
Pages: 1