Switch language
wpseek on Twitter


A WordPress-centric search engine for devs and theme authors




get_comment_time [ ]

get_comment_time ( $d = '', $gmt = false, $translate = true )
Parameters:
  • (string) $d Optional. The format of the time. Default user's settings.
  • (bool) $gmt Optional. Whether to use the GMT date. Default false.
  • (bool) $translate Optional. Whether to translate the time (for use in feeds). Default true.
Returns:
  • (string) The formatted time.
Defined at:
Codex



Retrieve the comment time of the current comment.

Source

function get_comment_time( $d = '', $gmt = false, $translate = true ) {
	global $comment;
	$comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date;
	if ( '' == $d )
		$date = mysql2date(get_option('time_format'), $comment_date, $translate);
	else
		$date = mysql2date($d, $comment_date, $translate);

	/**
	 * Filter the returned comment time.
	 *
	 * @since 1.5.0
	 *
	 * @param string|int $date      The comment time, formatted as a date string or Unix timestamp.
	 * @param string     $d         Date format.
	 * @param bool       $gmt       Whether the GMT date is in use.
	 * @param bool       $translate Whether the time is translated.
	 * @param object     $comment   The comment object.
	 */
	return apply_filters( 'get_comment_time', $date, $d, $gmt, $translate, $comment );
}

Top Google Search Results

More ...

User Note(s)