Title: get_comment_date
Published: April 25, 2014
Last modified: April 28, 2025

---

# apply_filters( ‘get_comment_date’, string|int $comment_date, string $format, WP_Comment $comment )

## In this article

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

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

Filters the returned comment date.

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

 `$comment_date`string|int

Formatted date string or Unix timestamp.

`$format`string

PHP date format.

`$comment`[WP_Comment](https://developer.wordpress.org/reference/classes/wp_comment/)

The comment object.

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

    ```php
    return apply_filters( 'get_comment_date', $comment_date, $format, $comment );
    ```

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

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

| Used by | Description | 
| [get_comment_date()](https://developer.wordpress.org/reference/functions/get_comment_date/)`wp-includes/comment-template.php` |

Retrieves the comment date of the current comment.

  |

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

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

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

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/hooks/get_comment_date/?output_format=md#comment-content-255)
 2.   [Nick C](https://profiles.wordpress.org/modernnerd/)  [  11 years ago  ](https://developer.wordpress.org/reference/hooks/get_comment_date/#comment-255)
 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%2Fhooks%2Fget_comment_date%2F%23comment-255)
    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%2Fhooks%2Fget_comment_date%2F%23comment-255)
 4. An example of filtering the comment date format:
 5.     ```php
        function custom_comment_date( $date, $d, $comment ) {
        	return mysql2date( 'F jS, Y', $comment->comment_date );
        }
        add_filter( 'get_comment_date', 'custom_comment_date', 10, 3);
        ```
    
 6. Use the standard PHP date format characters: [http://php.net/manual/en/function.date.php](http://php.net/manual/en/function.date.php)
 7.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fget_comment_date%2F%3Freplytocom%3D255%23feedback-editor-255)

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