Title: Real-time date changing
Last modified: November 21, 2021

---

# Real-time date changing

 *  Resolved [Roman](https://wordpress.org/support/users/vladroman/)
 * (@vladroman)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/real-time-date-changing/)
 * Hello.
 * wpDiscuz 7.3.7
 * For some reason I need to edit comments date without any change in DB.
 * I can do this by replacing html after page is generated. But this is not optimal
   way due to the high resource intensity of this operation.
 * Does wpDiscuz have any hook/filter, which allow to change date at plugin output?

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

 *  Plugin Support [gVectors Support](https://wordpress.org/support/users/gvectorssupport/)
 * (@gvectorssupport)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/real-time-date-changing/#post-15091722)
 * Hi Roman,
 * You can enable the “Use WordPress Date/Time Format” option, then use the code
   below.
    The option is located in the Dashboard > wpDiscuz > Settings > General
   Settings tab. More info here: [https://wpdiscuz.com/docs/wpdiscuz-7/plugin-settings/general-settings/#use-wordpress-date-time-format](https://wpdiscuz.com/docs/wpdiscuz-7/plugin-settings/general-settings/#use-wordpress-date-time-format)
 *     ```
       if (!function_exists("wpdModifyCommentDate")) {
   
           add_filter("get_comment_date", "wpdModifyCommentDate", 10, 3);
   
           function wpdModifyCommentDate($date, $format, $comment) {
               // do whatever you want
               return $date;
           }
   
       }
       ```
   
 * Put the code in the active theme functions.php file. This article should be helpful
   for you; [https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/](https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/)
 *  Thread Starter [Roman](https://wordpress.org/support/users/vladroman/)
 * (@vladroman)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/real-time-date-changing/#post-15092061)
 * Thank you for quick and detailed answer.
 * Yes, option “Use WordPress Date/Time Format” is enabled. At same time I use sorting
   by comment date, not ID.
 * Will filter get_comment_date have effect to comment sorting in this case?
    I 
   need to change date only in html output. Without any effect to something else.
 *  Plugin Support [gVectors Support](https://wordpress.org/support/users/gvectorssupport/)
 * (@gvectorssupport)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/real-time-date-changing/#post-15092088)
 * Roman,
 * No, it won’t affect comment sorting at all. It just changes the date visually.
 *  Thread Starter [Roman](https://wordpress.org/support/users/vladroman/)
 * (@vladroman)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/real-time-date-changing/#post-15093050)
 * Thank you. This works good.
 * But now, after tests, I found out, that wpDiscuz comment time format looks much
   better. 🙂
    Can I correct comment time in html output, if “Use WordPress Date/
   Time Format” is disabled? I need this only in some rare cases, so most of time
   comment time will be shown with better wpDiscuz format.
 *  Thread Starter [Roman](https://wordpress.org/support/users/vladroman/)
 * (@vladroman)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/real-time-date-changing/#post-15093592)
 * Looks like wpDiscuz generate comment time text in
    function dateDiff from includes/
   wc-helper.php. Don’t see hooks there.
 * Up lvl function get_comment_template from comment-form/tpl-comment.php doesn’t
   have hooks too.
 * So, no chance do something here?
 *  Plugin Support [gVectors Support](https://wordpress.org/support/users/gvectorssupport/)
 * (@gvectorssupport)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/real-time-date-changing/#post-15095246)
 * We’ll add a new hook in the wpDiscuz in future versions, so you’ll be able to
   get it to work with the wpDiscuz date/time format as well.
 *  Thread Starter [Roman](https://wordpress.org/support/users/vladroman/)
 * (@vladroman)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/real-time-date-changing/#post-15095549)
 * Thank you a lot. I will wait. 🙂
    wpDiscuz format for comments date/time really
   better.

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

The topic ‘Real-time date changing’ is closed to new replies.

 * ![](https://ps.w.org/wpdiscuz/assets/icon-256x256.png?rev=1076265)
 * [Comments - wpDiscuz](https://wordpress.org/plugins/wpdiscuz/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpdiscuz/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpdiscuz/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdiscuz/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdiscuz/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdiscuz/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [Roman](https://wordpress.org/support/users/vladroman/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/real-time-date-changing/#post-15095549)
 * Status: resolved