Title: Display friendly date format
Last modified: August 19, 2016

---

# Display friendly date format

 *  [callender](https://wordpress.org/support/users/jimcallender/)
 * (@jimcallender)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/display-friendly-date-format/)
 * Hi,
 * I am using – `($comment->comment_date_gmt)`
 * which gives the following format:
 * 2010-10-12 11:56:52
 * is there a friendly format, that gives the following?
 * 12 October 2010
 * Many thanks in advance,
 * Jim C.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/display-friendly-date-format/#post-1716725)
 * [http://codex.wordpress.org/Function_Reference/comment_date](http://codex.wordpress.org/Function_Reference/comment_date)
 *  Thread Starter [callender](https://wordpress.org/support/users/jimcallender/)
 * (@jimcallender)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/display-friendly-date-format/#post-1716727)
 * thanks Esmi, you are the best!
 *  Thread Starter [callender](https://wordpress.org/support/users/jimcallender/)
 * (@jimcallender)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/display-friendly-date-format/#post-1716739)
 * Oh, just looking at the code, its not quite that easy as i’m using wpdb to show
   the code directly from the sql table into a custom page template.
 * Can you advise what the code would be? as the php snippet you included doesnt
   work:
 *     ```
       <?php
       				global $wpdb;
       				$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID,
       				comment_post_ID, comment_author, comment_date_gmt, comment_approved,
       				comment_type,comment_author_url,
       				SUBSTRING(comment_content,1,100) AS com_excerpt
       				FROM $wpdb->comments
       				LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID =
       				$wpdb->posts.ID)
       				WHERE comment_approved = '1' AND comment_type = '' AND
       				post_password = ''
       				ORDER BY <strong>comment_date_gmt</strong> DESC
       				LIMIT 3";
       				$comments = $wpdb->get_results($sql);
       				$output = $pre_HTML;
       				$output .= "\n<ul>";
       				foreach ($comments as $comment) {
       				$output .= "\n<li>".strip_tags($comment->comment_author)
       				." commented on <br />" . "<a href=\"" . get_permalink($comment->ID) .
       				"#comment-" . $comment->comment_ID . "\" title=\"on " .
       				$comment->post_title . "\">" . strip_tags($comment->post_title, comment_date)
       				.
       				"<br />" . strip_tags($comment-><strong>comment_date_gmt</strong>) ."</li>";
       				"></a></li>";
       				}
       				$output .= "\n</ul>";
       				$output .= $post_HTML;
       				echo $output;?>
       ```
   
 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/display-friendly-date-format/#post-1716814)
 * In that case, you may want to have a look at PHP’s [date function](http://uk2.php.net/manual/en/function.date.php).

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Display friendly date format’ is closed to new replies.

## Tags

 * [date](https://wordpress.org/support/topic-tag/date/)
 * [GMT](https://wordpress.org/support/topic-tag/gmt/)
 * [time](https://wordpress.org/support/topic-tag/time/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/display-friendly-date-format/#post-1716814)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
