Date Formats
Movable Type lets you specify the exact formatting of dates and times that are displayed anywhere on your site. The system uses a simple code to represent the part of the time or date, as well as the specific display you've chosen. The default option, for example, is %x, which outputs date in the normal format for your region.
In US English, that represents %B %d, %Y, where %B is a full name of a month, like "September", %d is the two-digit day of the month, with a leading "0" if needed, like "06", and %Y is the four-digit year, like "2007".
Date and Time Codes
The following are the recognized date and time format codes:
General
%xThe language-aware standard date representation. For most languages, this is just the same as %B %d, %Y. Example: September 06, 2002.%XThe language-aware time representation. For most languages, this is just the same as %I:%M %p. Example: 04:31 PM.
Time
%IThe two-digit hour on a 12-hour clock padded with a zero if applicable. Example: 04.%lThe hour on a 12-hour clock padded with a space if applicable. Example: 4.%HThe two-digit military time hour padded with a zero if applicable. Example: 16.%kThe two-digit military time hour padded with a space if applicable. Example: 9.%MThe two-digits minute padded with a leading zero if applicable. Example: 02.%SThe two-digit second padded with a zero if applicable. Example: 04.%pEither AM or PM. Language dependent.
Dates
%AThe full weekday name. Example: Thursday.%aThe abbreviated weekday name. Example: Thu.%BThe full month name. Example: September.%bThe abbreviated month name. Example: Sep.%mThe two-digit month padded with a leading zero if applicable. Example: 09.%dThe two-digit day of the month padded with leading zeroes if applicable. Example: 09.%eThe day of the month space padded if applicable. Example: 9.%YThe four-digit year. Example: 2001.%yThe two-digit year padded with a leading zero if applicable. Example: 01.%jThe three-digit day of the year padded with leading zeroes if applicable. Example: 040.%wThe numeric day of the week ranging from 0 to 6 where 0 is Sunday. Example: 0
Language Codes
The following is a list of the recognized language codes:
- cz - Czechoslovakian
- dk - Scandinavian
- nl - Dutch
- en - English
- fr - French
- de - German
- is - Icelandic
- jp - Japanese
- it - Italian
- no - Norwegian
- pl - Polish
- pt - Portuguese
- si - Slovenian
- es - Spanish
- fi - Finnish
- se - Swedish
Technical details
All date and time tags inherit the two attributes that control their presentation.
Movable Type uses standard strftime format strings to describe date and time layouts using the format attribute. Furthermore, the language attribute can be used to override the weblog's preferred language setting in weekday names, month names, and AM/PM codes. This override will apply only for the particular date string that you are formatting.
As of version 2.0 of Movable Type, %Z is no longer supported. For the timezone see the MTBlogTimezone tag.

Leave a note