Content last modified Monday 6 March 2017
hop to #bottom
About It:
Rate it:
  • Helpful?
  • 1 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

Changing the Date Format

You probably know you can change the Date format, Archive date format, and Comments date format by hitting up your ‘admin’ tab and ‘preferences’ tab underneath that, in your Admin panel. ( )

You can also override this format, by supplying the Textpattern tag, <txp:posted />, with one argument, “format”.

In all pre-1.0RC3 versions, this tag relies upon the formats allowed by the PHP function, date(). Example:
<txp:posted format="d m Y" />

In version 1.0RC3 and forwards, this tag relies upon the formats allowed by the PHP function, strftime(). Example:
<txp:posted format="%d %m %Y" />

These two formats cannot be “mixed and matched”. Only date() format strings will work in pre-1.0RC3 versions, and only strftime() format strings will work hereafter.

The reason for the switch was to enable date and time localisation.

Should you desire to use the date() format in 1.0RC3 or greater, a plugin is available that will enable you to do so. Example:
<txp:jad_oldposted format="d m Y" />

(additional thanks to Beate)

Article Request Count:
Initially released:
Posted here:
30 Nov 2004
Article modified:
07 Apr 2005

You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:

Commenting is closed for this article.

Commented (4)

I prefer editing txp_prefs.php to remove formats from the pulldown that I’ll never use and replace them with ones I like. Once you’re in that file, it’s pretty self-explanatory. I dislike having to do this with each upgrade, but it’s a price I willing pay … for now.

i love your site, hope you love mine

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.




There are also tag clouds, 'cause those are fun.
Published with Textpattern