Forums

Time of comments doesn't show properly (4 posts)

  1. clovek57
    Member
    Posted 2 years ago #

    Hi, I use Recent comments plugin. When I post a comment, it looks like this:
    admin says:
    %A %B %e%q, %Y at %I:%M %p

    I think the source is in /wp-includes/comment-template.php and there are called get_comment_date() and get_comment_time() functions...

    Any ideas how to solve that?

  2. IleaCristian
    Member
    Posted 2 years ago #

    I have the exact same problem:(

    Please , help?

  3. theshine
    Member
    Posted 1 year ago #

    It's totally hackish, but you can go into /wp-includes/comment-template.php and change the get_comment_time function to look something like this:

    function get_comment_time( $d = 'h:i a', $gmt = false, $translate = true ) {

    Adding the 'h:i a' should give you the current time, bear in mind this file will probably get overwritten next time you upgrade WordPress. Also this is really "not" the right way to do things. You should call get_comment_time() in the comments.php template and initialize it with the correct arguments at the time. Unfortunately though, the wp_list_comments() function (which most people use) doesn't accept a time formatting argument, which would make everyone's life easier.

  4. dansearle
    Member
    Posted 1 year ago #

    Do you have qTranslate installed? If so, go to the qTranslate Configuration in under Plugins and check that "Use strftime" is checked - do that then check the comments again. That worked for me anyway.

Topic Closed

This topic has been closed to new replies.

About this Topic