Title: the_modified_time
Published: April 25, 2014
Last modified: August 20, 2026

---

# the_modified_time( string $format = '' )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#parameters)
 * [More Information](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#wp--skip-link--target)

Displays the time at which the post was last modified.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#parameters)󠁿

 `$format`stringoptional

Format to use for retrieving the time the post was modified. Accepts `'G'`, `'U'`,
or PHP date format.
 Defaults to the `'time_format'` option.

Default:`''`

## 󠀁[More Information](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#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:

    ```php
    if ( get_the_modified_time() != get_the_time()) )
    ```

## 󠀁[Source](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#source)󠁿

    ```php
    function the_modified_time( $format = '' ) {
    	/**
    	 * Filters the localized time a post was last modified, for display.
    	 *
    	 * @since 2.0.0
    	 *
    	 * @param string|false $get_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', get_the_modified_time( $format ), $format );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/general-template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/general-template.php#L3219)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/general-template.php#L3219-L3230)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#hooks)󠁿

 [apply_filters( ‘the_modified_time’, string|false $get_the_modified_time, string $format )](https://developer.wordpress.org/reference/hooks/the_modified_time/)

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

## 󠀁[Related](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#related)󠁿

| Uses | Description | 
| [get_the_modified_time()](https://developer.wordpress.org/reference/functions/get_the_modified_time/)`wp-includes/general-template.php` |

Retrieves the time at which the post was last modified.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#user-contributed-notes)󠁿

 1.   [Skip to note 6 content](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#comment-content-1068)
 2.    [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/the_modified_time/#comment-1068)
 3.  [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%23comment-1068)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%23comment-1068)
 4.  **Default Usage**
 5.  Displays the time (date) the post was last modified, using the Default date format
     setting (e.g. F j, Y) from Administration > Settings > General.
 6.      ```php
         <p>Last modified: <?php the_modified_time(); ?></p>
         ```
     
 7.  Output is “Last modified: December 2, 2006”
 8.   [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%3Freplytocom%3D1068%23feedback-editor-1068)
 9.   [Skip to note 7 content](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#comment-content-1069)
 10.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/the_modified_time/#comment-1069)
 11. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%23comment-1069)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%23comment-1069)
 12. **Time in the 12-hour format (am/pm)**
      If a post was modified at 10:36pm, this
     example displays the time the post was last modified using the 12-hour format 
     parameter string ‘g:i a’.
 13.     ```php
         <p>Time last modified: <?php the_modified_time('g:i a'); ?></p>
         ```
     
 14. Output is “Time last modified: 10:36 pm”
 15.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%3Freplytocom%3D1069%23feedback-editor-1069)
 16.  [Skip to note 8 content](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#comment-content-1070)
 17.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/the_modified_time/#comment-1070)
 18. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%23comment-1070)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%23comment-1070)
 19. **Time in the 24-hour format**
 20. If a post was modified at 10:36pm, this example displays the time the post was
     last modified using the 24-hour format parameter string ‘G:i’.
 21.     ```php
         <p>Time last modified: <?php the_modified_time('G:i'); ?></p>
         ```
     
 22. Output is “Time last modified: 22:36”
 23.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%3Freplytocom%3D1070%23feedback-editor-1070)
 24.  [Skip to note 9 content](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#comment-content-1072)
 25.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/the_modified_time/#comment-1072)
 26. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%23comment-1072)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%23comment-1072)
 27. **Date as Month Day, Year**
 28. 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()](https://developer.wordpress.org/reference/functions/the_modified_date/).
 29.     ```php
         <div>Last modified: <?php the_modified_time('F j, Y'); ?></div>
         ```
     
 30. Output is “Last modified: December 2, 2006”.
 31.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%3Freplytocom%3D1072%23feedback-editor-1072)
 32.  [Skip to note 10 content](https://developer.wordpress.org/reference/functions/the_modified_time/?output_format=md#comment-content-1073)
 33.   [Codex](https://profiles.wordpress.org/codex/)  [  11 years ago  ](https://developer.wordpress.org/reference/functions/the_modified_time/#comment-1073)
 34. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%23comment-1073)
     Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%23comment-1073)
 35. **Date and Time**
 36. Displays the date and time.
 37.     ```php
         <p>Modified: <?php the_modified_time('F j, Y'); ?> at <?php the_modified_time('g:i a'); ?></p>
         ```
     
 38. Output is “Modified: December 2, 2006 at 10:36 pm”.
 39.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F%3Freplytocom%3D1073%23feedback-editor-1073)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fthe_modified_time%2F)
before being able to contribute a note or feedback.