August 12, 2011

Advanced Templates: Date and Time Tags

Advanced Template Set designs are available with the Unlimited, Premium, and Business Class plans.

Date Tags can be used to format dates and times in a variety of different configurations to suit your needs and preferences in an Advanced Template Set. You can use date tags in conjunction with other tags such as MTEntryDate, MTPingDate, and MTCommentDate.

Without a format set, the date tags default to what is set on Settings > Posts.

Usage: <$MTEntryDate format="%A"$>

%a
The abbreviated weekday name. Example: Thu.
%A
The full weekday name. Example: Thursday.
%b
The abbreviated month name. Example: Sep.
%B
The full month name. Example: September.
%d
The two-digit day of the month padded with leading zeroes if applicable. Example: 09.
%e
The day of the month space padded if applicable. Example: 9.
%H
The two-digit military time hour padded with a zero if applicable. Example: 16.
%I
The two-digit hour on a 12-hour clock padded with a zero if applicable. Example: 04.
%j
The three-digit day of the year padded with leading zeroes if applicable. Example: 040.
%k
The two-digit military time hour padded with a space if applicable. Example: 9.
%l
The hour on a 12-hour clock padded with a space if applicable. Example: 4.
%m
The two-digit month padded with a leading zero if applicable. Example: 09.
%M
The two-digits minute padded with a leading zero if applicable. Example: 02.
%p
Either AM or PM. Language dependent.
%S
The two-digit second padded with a zero if applicable. Example: 04.
%w
The numeric day of the week ranging from 0 to 6 where 0 is Sunday. Example: 0
%x
The language-aware standard date representation. For most languages, this is just the same as %B %d, %Y. Example: September 06, 2002. Shows same as default.
%X
The language-aware time representation. For most languages, this is just the same as %I:%M %p. Example: 04:31 PM. Shows same as default.
%y
The two-digit year padded with a leading zero if applicable. Example: 01.
%Y
The four-digit year. Example: 2012

The language attribute is also supported. Applies to weekday names (%a, %A), month names (%b, %B, and in %X), and am/pm code (%p).

You can set the language for date display in Weblogs > Configure > Preferences, and this is used as the default if no language is specified for the tag.

Usage: <$MTEntryDate format="%A" language="fr"$>

  • ar - Arabic
  • zh - Chinese
  • hr - Croatian
  • cs - Czech
  • da - Danish
  • nl - Dutch
  • en - English
  • fa - Farsi
  • fi - Finnish
  • fr - French
  • de - German
  • el - Greek
  • he - Hebrew
  • hi - Hindi
  • hu - Hungarian
  • is - Icelandic
  • id - Indonesian
  • it - Italian
  • ja - Japanese
  • ko - Korean
  • lt - Lithuanian
  • no - Norwegian
  • pl - Polish
  • pt - Portuguese
  • ru - Russian
  • ro - Romanian
  • sr - Serbian
  • sk - Slovak
  • sl - Slovenian
  • es - Spanish
  • sv - Swedish
  • th - Thai
  • tr - Turkish
  • vi - Vietnamese

Typepad also uses the following date tag attributes:

timezone
Values used: UTC, use offset in format ±hhmm to specify other timezones.
For instance PST is GMT -8 so the offset in Perl format is -0800. Australian Central Daylight Time (GMT +10:30) would be +1030
format_weblog_date
Sets the tag to use the Date Format set in Weblogs > Configure > Preferences.
Values used: 1, 0
format_name
Value used: W3CDTF (format required for RSS feeds)
Search


Need design help?

Looking to launch a new blog? Have an itch to tweak your design or layout? Want a superior banner or design custom made specifically for your blog? We've got you covered!

Discover Typepad Services