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

Filters the returned comment date.

Parameters

$comment_datestring|int
Formatted date string or Unix timestamp.
$formatstring
PHP date format.
$commentWP_Comment
The comment object.

Source

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

Changelog

VersionDescription
1.5.0Introduced.

User Contributed Notes

  1. Skip to note 2 content

    An example of filtering the comment date format:

    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);

    Use the standard PHP date format characters: http://php.net/manual/en/function.date.php

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