Displays the comment date of the current comment.
Parameters
$format
stringoptional- PHP date format. Defaults to the
'date_format'
option.Default:
''
$comment_id
int|WP_Commentoptional- WP_Comment or ID of the comment for which to print the date.
Default current comment.
Source
function comment_date( $format = '', $comment_id = 0 ) {
echo get_comment_date( $format, $comment_id );
}
Changelog
Version | Description |
---|---|
4.4.0 | Added the ability for $comment_id to also accept a WP_Comment object. |
0.71 | Introduced. |
Basic Example
Displays the current comment date in the format “6-30-2004”: