WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get comment date

Description

Retrieve the comment date of the current comment.

Usage

<?php get_comment_date$d$comment_ID ); ?>

Parameters

$d
(string) (optional) Date format. If empty, it will default to get_option( 'date_format' ) (the format configured in the site's settings).
Default: Empty string
$comment_ID
(int) (optional) A comment ID. If empty, the current comment will be used.
Default: 0

Returns

(String) 
Formatted comment date.

Examples

<?php 

$d = "l, F jS, Y";
$comment_date = get_comment_date( $d, $comment_ID );
echo $comment_date;

// This will output something similar to "Saturday, November 6th, 2010". 

?>

Notes

Change Log

Source File

get_comment_date() is located in wp-includes/comment-template.php

Related

Formatting Date and Time

Comments Functions