comment_date

Display the comment date of the current comment.

Description

comment_date( (string) $d = '', (int) $comment_ID = 0 ); 

Parameters (2)

0. $d — Optional. (string) => ''
The format of the date. Default user's settings.
1. $comment_id (int)
WP_Comment or ID of the comment for which to print the date. Default current comment.

Usage

  1. if ( !function_exists( 'comment_date' ) ) { 
  2. require_once ABSPATH . WPINC . '/comment-template.php'; 
  3.  
  4. // Optional. The format of the date. Default user's settings. 
  5. $d = ''; 
  6.  
  7. // WP_Comment or ID of the comment for which to print the date. 
  8. // Default current comment. 
  9. $comment_id = -1; 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = comment_date($d, $comment_id); 
  13.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/comment-template.php  
  1. function comment_date( $d = '', $comment_ID = 0 ) { 
  2. echo get_comment_date( $d, $comment_ID );