comment_time()WP 0.71

Display the comment time of the current comment.

No Hooks.

Return

null. Nothing.

Usage

comment_time( $format );
$format(string)
PHP time format. option.
Default: 'time_format'

Examples

0

#1 Print the time of the current comment in the format 22:04:11.

The code should be used inside the comment loop, usually a built-in function specified in the callback parameter of the wp_list_comments() function is responsible for displaying comments:

<p>Comment publishing time: <?php comment_time('H:i:s'); ?></p>

Changelog

Since 0.71 Introduced.

comment_time() code WP 6.1.1

function comment_time( $format = '' ) {
	echo get_comment_time( $format );
}