Go to main content


On this page:


<txp:posted />

The posted tag is a single tag which is used to return the publish date of the article being displayed. The format is determined by the settings specified in the ‘Date format’ or ‘Archive date format’ fields in the Preferences panel.


Tag will accept the following attributes (case-sensitive):

format="format string"
Override the default date format set in the Preferences panel.
Values: any valid strftime string values, since, iso8601 (ISO 8601 reference), w3cdtf (W3CDTF reference), or rfc822 (RFC 822 reference).
Default: the ‘Date format’ set in preferences.
Return either local time (according to the set time zone preferences) or GMT.
Values: 0 (local time) or 1 (GMT).
Default: 0.
lang="ISO language code"
Format time string suitable for the specified language (locale).
Values: locales adhere to ISO-639.
Default: unset (time format set in the Preferences panel.

Common presentational attributes

class="class name" v4.0.4+
HTML class to apply to the wraptag attribute value.
Default: unset (see class cross-reference).
wraptag="element" v4.0.4+
HTML element to wrap (markup) the posted date, specified without brackets (e.g. wraptag="p").
Default: unset (but see wraptag cross-reference for exceptions).


Example 1: ‘since’ format date setting

    <txp:posted format="since" />

This would result in the following HTML output:

<p>Posted: 29 days ago</p>

Example 2: Custom format date setting

    <txp:posted format="%b %d, %Y" />

This would result in the following HTML output:

<p>Posted: Feb 03, 2014</p>

Example 3: Extended custom format date setting

    <time datetime="<txp:posted format="iso8601" />">
        <txp:posted class="time-day" wraptag="span" format="%d" />
        <txp:posted class="time-month" wraptag="span" format="%b" />
        <txp:posted class="time-year" wraptag="span" format="%Y" />

This would result in the following HTML output:

    <time datetime="2014-02-03T10:43:39Z">
        <span class="time-day">03</span>
        <span class="time-month">Feb</span>
        <span class="time-year">2014</span>

This provides styling hooks for each date part.


Version 4.0.4

class and wraptag attributes added.

If you notice any kind of problem with this page’s construction or content (outdated information, typos, broken links, or whatever), open an issue to have it sorted. Or have a go at it yourself. :)