Chapter 3: Templates and Layout
Formatting a Date
Problem
You want to format the timestamp of a date tag.
Solution
Use the format attribute with the Date Tag Format
codes.
Discussion
Movable Type provides added functionality to tags that handle date and
time information. These tags will recognize a format attribute
that defines the explicit date/time format to output. These formats are
based on the strftime utility found on all Unix systems. A
complete listing of the codes can be found in Appendix C.
For instance, if you were to insert this template markup into the context of an entry:
<$MTEntryDate format="%B %e, %Y %l:%M %p"$>
<$MTEntryDate format="%A"$>
<$MTEntryDate format="%H:%m"$>
Although the MTEntryDate tag will always retrieve the same
value, it will be formatted in three different ways. The output of these
tags would look something like:
April 22, 2005 3:26 PM
Friday
15:26
Typically these tags have "date" in their name, however you should
consult the Appendix A about
whether or not the format attribute applies to a given
tag.



