You should use strtotime
to turn the comment’s date into a string that can be compared with the current time. In your case, you should use:
echo human_time_diff( strtotime( $comment->comment_date ), current_time( 'timestamp', 1 ) );
Related Posts:
- How to Delete Old Comments by Date?
- SQL query to delete comments older than 90 days?
- Get last seen date/time in wordpress get_comments() [closed]
- Changing “submitted on date” of comments
- Placed on + only date (not time)
- How to amend time format of comments, using child-theme?
- comment_date() & comment_time() not working from functions.php
- Disable comments on all posts/pages
- Stop WordPress redirecting comment-page-1 to the post page?
- Importing old Disqus comments into WordPress
- How to add a class to the comment submit button?
- Would switching to InnoDB from MyISAM improve performance of comments table?
- Linking to Page Showing Only Comments Without Parent Post
- Comments screen in backend, how to disable email address of commenter for non admins
- Post Comments using WP REST API v2 in WordPress
- Show content only if member left a comment
- Link name in comments to Author page? Comment Author Meta in Comments?
- Showing comments only to same custom user role
- Linking comments from registered users to their profile pages
- Vanilla Forums as a replacement for WordPress comments?
- How to enable reply on most-deeply-nested comments?
- Top Commenters: exclude admin
- Comments to Custom Post Type
- Get Comments: Direct link to specific comment + post title
- How can I show comments in random order?
- comments are coming on improper posts
- Is there any way to override “break comments into pages” and “close comments for old posts” on certain posts, but not on others?
- migrate comments from old database to new database
- Toggle nested comments
- Is it possible to make wp insert last comment onto another page
- How to allow only Admins or Logged In Users to post links in comments?
- wp_insert_comment error. puzzled by date value
- Private replies for comments
- Show last n comments
- Threaded commenting: how to show threads by last active first?
- edit_comment capability for subscriber
- How to add attributes to the comment form tag?
- How to add replyToUrl schema.org to WordPress comments?
- Follow-up Comments Notification Without a Plug-in
- oEmbed does not work for comments
- Get comments from post and sort by commentmeta value
- Yoast makes comment_reply_link function output plain link to comment instead of reply link
- Problems with comments callback (Argument #1 is not an array?)
- Can WordPress comments have titles and taxonomy?
- Same email for all comments
- Comments system doesn’t like International domains
- List comments received by every posts of an specific author
- Display date and time in comments
- How do I reply to comments from admin panel on a tablet PC?
- Disable comments for a user? [closed]
- Polls with respective comments?
- Why does akismet prevent jetpack comments from appearing in my moderation queue? [closed]
- Ajax submit comments
- I cannot view the comments
- Problem with WordPress Comment
- In wp_list_comments comment dates won’t work?
- Where are comment ratings stored?
- Comments change the template name
- I can’t post comment via REST API
- how to SELECT for the current post id?
- WordPress scruity issue – Totally disable all comments by CSS — secure enough?
- wp_new_comment requires author url and author email
- Custom comment link
- How to display the user’s comment status on the front end
- get_comments_number() vs. get_post_field( ‘comment_count’, ID )
- Where are comments coded when using custom theme?
- What is the point of get_comment_count() if you cannot limit by a comment type?
- Wrong IP address in comment section
- Comments turned off, but ‘Leave a reply’ link still there [duplicate]
- How to output number of comments with link to comments
- How do I make Twenty Ten display comments on the home page?
- How to remove the “comments” bit that appears next to or below the posts
- Sort post comments from newest to oldest in pagination
- Get all comments associated with a specific page ID (comment_post_ID)
- How do I add custom field to Admin comment form and display
- I would like to count number of comments after 5 days ago
- Using Disqus with headless WordPress setup?
- Attaching author tag to the comment
- Pre- Approved Comment Capability
- Delete comments function
- Comment form not working
- How to show a “Comments Are Closed” message on posts where comments have been closed?
- Necessary to have a comments.php if there are no comments?
- Comments pagination on author page
- Comments page id wp_list_comments
- Inserting comments via a procedure
- Can I use WP comments for custom tables?
- How can I have a full comments.php for an easy editing of all its aspects?
- Transfer comments from one domain to another
- WordPress is adding above html
- Passing user meta through comment form
- writing a plugin, how to disable the comment form altogether?
- How do I convert users who put an email and username for a comment into registered users? [duplicate]
- Function to get a list of all comments on 1 post [closed]
- Display DISQUS on homepage
- How to stop a specific person to comment on my blog? [closed]
- Auto delete WordPress comments
- comment awaiting moderation
- How do you fetch the authors email or IP from /comments? (REST API)
- How can I filter the user avatar displayed in comments? – get_avatar_url filter works everywhere but not in comments