Codex

Template Tags/the modified date

Contents

Description

This tag displays the date (and time) a post was last modified. This tag works just like the_modified_time(), which also displays the time/date a post was last modified. This tag must be used within The Loop. If no format parameter is specified, the Default date format (please note that says Date format) setting from Administration > Settings > General is used for the display format.

If the post or page is not yet modified, the modified date is the same as the creation date.

Usage

 <?php the_modified_date('d'); ?> 

Examples

Default Usage

Displays the date the post was last modified, using the Default date format setting (e.g. F j, Y) from Administration > Settings > General.

<p>Last modified: <?php the_modified_date(); ?></p>
Last modified: December 2, 2006

Date as Month Day, Year

Displays the last modified date in the date format 'F j, Y' (ex: December 2, 2006).

<div>Last modified: <?php the_modified_date('F j, Y'); ?></div>
Last modified: December 2, 2006

Date and Time

Displays the date and time.

<p>Modified: <?php the_modified_date('F j, Y'); ?> at <?php the_modified_date('g:i a'); ?></p>
Modified: December 2, 2006 at 10:36 pm

Parameters

(string) The format the date is to display in. Defaults to the date format configured in your WordPress options. See Formatting Date and Time.

Related

the_date_xml, the_date, the_time, the_modified_date, the_modified_time, get_the_time, single_month_title, get_calendar, the_weekday, the_weekday_date

How to pass parameters to tags

Go to Template Tag index