Movable Type Documentation

« Global tag attribute filters | Up | Introduction »

Chapter C: Date Formats

Movable Type Date Formats

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.

Date and Time Codes

The following are the recognized date and time format codes:

  • %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.

  • %X

    The language-aware time representation. For most languages, this is just the same as %I:%M %p. Example: 04:31 PM.

  • %y

    The two-digit year padded with a leading zero if applicable. Example: 01.

  • %Y

    The four-digit year. Example: 2001.

As of version 2.0 of Movable Type, %Z is no longer supported. For the timezone see the MTBlogTimezone tag.

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

This is what was in the old manual. Are all of these recognized or is it just the "official" languages? What are those 5 again? I think I labeled them above, but wanted to check.

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or question. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.