comment_time

The timeline below displays how wordpress function comment_time has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 2.1

/**
 * Displays the comment time of the current comment.
 *
 * @since 0.71
 * @since 6.2.0 Added the `$comment_id` parameter.
 *
 * @param string         $format     Optional. PHP time format. Defaults to the 'time_format' option.
 * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to print the time.
 *                                   Default current comment.
 */
function comment_time($format = '', $comment_id = 0)
{
    echo get_comment_time($format, false, true, $comment_id);
}

WordPress Version: 6.2

/**
 * Displays the comment time of the current comment.
 *
 * @since 0.71
 * @since 6.2.0 Added the `$comment_id` parameter.
 *
 * @param string         $format     Optional. PHP time format. Defaults to the 'time_format' option.
 * @param int|WP_Comment $comment_id Optional. WP_Comment or ID of the comment for which to print the time.
 *                                   Default current comment.
 */
function comment_time($format = '', $comment_id = 0)
{
    echo get_comment_time($format, $comment_id);
}

WordPress Version: 5.7

/**
 * Displays the comment time of the current comment.
 *
 * @since 0.71
 *
 * @param string $format Optional. PHP time format. Defaults to the 'time_format' option.
 */
function comment_time($format = '')
{
    echo get_comment_time($format);
}

WordPress Version: 5.6

/**
 * Displays the comment time of the current comment.
 *
 * @since 0.71
 *
 * @param string $format Optional. PHP date format. Defaults to the 'time_format' option.
 */
function comment_time($format = '')
{
    echo get_comment_time($format);
}

WordPress Version: 5.4

/**
 * Displays the comment time of the current comment.
 *
 * @since 0.71
 *
 * @param string $format Optional. The format of the time. Default user's settings.
 */
function comment_time($format = '')
{
    echo get_comment_time($format);
}

WordPress Version: 3.7

/**
 * Display the comment time of the current comment.
 *
 * @since 0.71
 *
 * @param string $d Optional. The format of the time. Default user's settings.
 */
function comment_time($d = '')
{
    echo get_comment_time($d);
}