Title: Incorrect modified dates
Last modified: April 12, 2018

---

# Incorrect modified dates

 *  Resolved [dstonyh](https://wordpress.org/support/users/dstonyh/)
 * (@dstonyh)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/incorrect-modified-dates/)
 * Hello,
 * First, I very much like and enjoy this plugin, it works well.
 * For my issue, however, I’ve been seeing incorrect modified dates, sometimes they
   were all the same time, just wrong, and I even had one that was modified in the
   year 4007. I enabled PHP Error Reporting, and saw this: [http://prntscr.com/j4gofp](http://prntscr.com/j4gofp)
 * Looking at the code, I fixed it with this (..includes/admin-screens.php:308):
 *     ```
       if (version_compare($wp_version, '4.6', '>=')) {
       	$m_time = get_the_modified_time('Y\/m\/d g\:i\:s a', $post_id);
       }
       else {
       	$m_time = get_the_modified_time('U', $post_id);
       }
   
       $dtime = DateTime::createFromFormat("Y\/m\/d g\:i\:s a", $m_time);
       $timestamp = $dtime->getTimestamp();
       $time_diff = time() - $timestamp;
       ```
   
 * Result: [http://prntscr.com/j4gsza](http://prntscr.com/j4gsza)
 * For reference, I’m using WordPress 4.9.5, PHP version 7.2.3.
 * Thanks,
    Tony.
    -  This topic was modified 7 years, 11 months ago by [dstonyh](https://wordpress.org/support/users/dstonyh/).
    -  This topic was modified 7 years, 11 months ago by [dstonyh](https://wordpress.org/support/users/dstonyh/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fincorrect-modified-dates%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [SilkyPress](https://wordpress.org/support/users/diana_burduja/)
 * (@diana_burduja)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/incorrect-modified-dates/#post-10177208)
 * Thank you for mentioning this.
 * Apparently the warning shows up for PHP 7.2.+. We’ll fix this as soon as possible.
 *  Thread Starter [dstonyh](https://wordpress.org/support/users/dstonyh/)
 * (@dstonyh)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/incorrect-modified-dates/#post-10178293)
 * Thank you, appreciate you looking into it. I’ll mark this as resolved for now.
 *  Plugin Author [SilkyPress](https://wordpress.org/support/users/diana_burduja/)
 * (@diana_burduja)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/incorrect-modified-dates/#post-10207505)
 * This is fixed in the 3.16 version.
 *  Thread Starter [dstonyh](https://wordpress.org/support/users/dstonyh/)
 * (@dstonyh)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/incorrect-modified-dates/#post-10244035)
 * Hello Diana,
 * It does look much better now, however the modified time on my site is still incorrect,
   it’s offset by 7 hours, since I have my WordPress timezone set to -7 (Pacific
   Time). Not a huge deal, but if you look into this again, I would see about correcting
   the time for different time zones based on settings.
 * Thanks,
    Tony.
 *  Plugin Author [SilkyPress](https://wordpress.org/support/users/diana_burduja/)
 * (@diana_burduja)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/incorrect-modified-dates/#post-10248263)
 * Hi Tony,
 * it looks like the [get_the_modified_time](https://developer.wordpress.org/reference/functions/get_the_modified_time/)
   function doesn’t take the timezone into account. The [get_post_modified_time](https://developer.wordpress.org/reference/functions/get_post_modified_time/)
   function is a better fit in this case.
 * I’ve made a “silent release” with the modifications, i.e. published the changes
   without making a new version. If you want to test it, then you need to uninstall
   the plugin and install it again.
 * Thank you for reporting this.

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

The topic ‘Incorrect modified dates’ is closed to new replies.

 * ![](https://ps.w.org/custom-css-js/assets/icon-128x128.png?rev=1303730)
 * [Simple Custom CSS and JS](https://wordpress.org/plugins/custom-css-js/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-css-js/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-css-js/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-css-js/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-css-js/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-css-js/reviews/)

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [modified date](https://wordpress.org/support/topic-tag/modified-date/)
 * [php-error](https://wordpress.org/support/topic-tag/php-error/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 5 replies
 * 2 participants
 * Last reply from: [SilkyPress](https://wordpress.org/support/users/diana_burduja/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/incorrect-modified-dates/#post-10248263)
 * Status: resolved