• i am use this action:
    add_filter( ‘comment_date’, array( $this, ‘tnCommentsColumns’ ) );
    public function tnCommentsColumns( $date )
    {
    $date = date( ‘Y-m-d H:i’ );

    return $date;
    }

    but it error,and it display two repeat date.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    I am sorry that the code you are using is not working as expected.

    The General Settings (DashboardSettingsGeneral) in WordPress enables you to change the format of the date which affects the comments.

    There are several formats to choose from and you can also enter in a custom date format.

    With regards to the code you are using, please make sure you are using the code in a class and the class is properly instantiated. If you have just added it in functions.php file then it won’t work.

    Kindly refer to this link by clicking here to see the correct code OR you can use the following Php code:

    function custom_comment_date( $date, $d, $comment ) {
        return mysql2date( 'F jS, Y', $comment->comment_date );
    }
    add_filter( 'get_comment_date', 'custom_comment_date', 10, 3);

    Please let me know if I can help you any further

    Usman

    Thread Starter bearshang

    (@bearshang)

    @usmanaliqureshi
    I follow what you did,
    unfortunately, the admin comment list shows two identical times.

    https://ojnt2lb2b.bkt.clouddn.com/20170823000602.png

    • This reply was modified 7 years, 3 months ago by bearshang.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to change comment display date formate in admin?’ is closed to new replies.