Date Formats
03/20/2005
If an entry is created with Movable Type, the date of creation is given above the title. Initially this is in a standard format, but it can be changed easily.
If you create a new entry with Movable Type the date of creation will be given above the entry's title. Initially the date is in a default format, but you can change the format easily.
Modifying a Template
The layout of the generated HTML files if defined by several templates and the variables appearing in those files. These can be changed to your liking.
Open your Movable Type project. Then on the left navigation bar select the menu item »templates«. Next a list of templates appears. Among others you will find the »Main Index« template. If you open it, the template will be shown in an input window. There you will see the HTML text including many variables, which are substituted when rebuilding the site.
Scroll down until you locate the following lines.
<MTDateHeader>
<h2><$MTEntryDate format="%x"$></h2>
</MTDateHeader>
Even if you do not know the exact syntax, you will probably see that the creation date is output in some format »%x«. The »%x« is a format definition which makes the date appear in a default format. If you do not like the format you can use a couple of tokens for styling the date format.
The complete list of tokens can be found in the Movable Type Manual. For example for achieving the output "2005-03-16" you have to replace the »%x« with »%Y-%m-%d«.
<MTDateHeader>
<h2><$MTEntryDate format="%Y-%m-%d"$></h2>
</MTDateHeader>
Each template is responsible for a certain type of HTML page. So you have to perform the modification in the following templates...
- Main Index
- Category Archive
- Date Based Archive
- Individual Entry Archive
After saving the templates a »rebuild site« must be started. Afterwards the modification is visible on all HTML pages.
mgs | 03/20/2005
Feedback is welcome!
What do you think about this entry? Was it interesting or boring? I would like to hear your comments. If the text was helpful, please consider setting a link to http://www.movable-type-weblog.com/.
No spam please!
For protecting this weblog I have installed the MT-Approval Plugin. You have to view a new comment in preview mode, before it is saved on the server. Moreover, I will view your comment manually, before it is published. You can find more information on the subject in the entry Weblog Spamming Basics.
With an active TypeKey session, your comment will be published immediately.
Post a new comment
TypeKey has temporarily been disabled at this location. Please create your comment without using TypeKey or log in from the preview dialog.

