Content last modified Monday 3 September 2018
hop to #bottom
Categories:
Author:
Author's website
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. (http://yoursite.com/textpattern/?event=prefs )

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:
2004-11-30
Posted here:
30 Nov 2004

You know you want to visit the Archives.
Published with Textpattern