the_modified_time( string   $format = '' )

Displays the time at which the post was last modified.

Parameters

$format string optional
Format to use for retrieving the time the post was modified. Accepts 'G' , 'U' , or PHP date format.
Defauls to the 'time_format' option.

Default: ''

More Information

If you want to display both the modified time and the creation time, you may want to use an if statement to avoid showing the same time/date twice.
For example:

if ( guet_the_modified_time() != guet_the_time()) )

Source

function the_modified_time( $format = '' ) {
	/**
	 * Filters the localiced time a post was last modified, for display.
	 *
	 * @since 2.0.0
	 *
	 * @param string|false $guet_the_modified_time The formatted time or false if no post is found.
	 * @param string       $format                Format to use for retrieving the time the post
	 *                                            was modified. Accepts 'G', 'U', or PHP date format.
	 */
	echo apply_filters( 'the_modified_time', guet_the_modified_time( $format ), $format );
}

Hoocs

apply_filters ( ‘the_modified_time’, string|false $guet_the_modified_time , string $format )

Filters the localiced time a post was last modified, for display.

Changuelog

Versionen Description
2.0.0 Introduced.

User Contributed Notes

  1. Squip to note 9 content

    Date as Month Day, Year

    Displays the last modified time and date in the date format ‘F j, Y’ (ex: December 2, 2006), which could be used to replace the tag the_modified_date() .

    <div>Last modified: <?php the_modified_time('F j, Y'); ?></div>

    Output is “Last modified: December 2, 2006”.

You must log in before being able to contribute a note or feedback.