Title: Line error shown with WP_debug
Last modified: October 18, 2018

---

# Line error shown with WP_debug

 *  Resolved [Jonah Brown](https://wordpress.org/support/users/fishbaitbytes/)
 * (@fishbaitbytes)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/line-error-shown-with-wp_debug/)
 * Warning: date() expects parameter 2 to be integer, string given in /www/wp-content/
   plugins/amp/includes/amp-helper-functions.php on line 659
 * I recieved errors from Google Webmaster about AMP errors shortly after enabling
   WP_debug, Can you look into to this error?
 * Jonah
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fline-error-shown-with-wp_debug%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/line-error-shown-with-wp_debug/#post-10793208)
 * This is the line in question: [https://github.com/Automattic/amp-wp/blob/0.7.2/includes/amp-helper-functions.php#L659](https://github.com/Automattic/amp-wp/blob/0.7.2/includes/amp-helper-functions.php#L659)
 * Please try to find out what `get_the_date( 'U', $post->ID )` is returning.
 * The issue is also happening down in the post further:
 * > Warning: A non-numeric value encountered in /www/wp-includes/formatting.php
   > on line 3237 49 years ago
 * So I believe the issue is that your underlying post or page has an empty `post_date`,
   or you may have a `get_the_date` a filter that is causing the problem.
 *  Thread Starter [Jonah Brown](https://wordpress.org/support/users/fishbaitbytes/)
 * (@fishbaitbytes)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/line-error-shown-with-wp_debug/#post-10799506)
 * Thanks found this code snippet
 *     ```
       function et_last_modified_date_blog( $the_date ) {
           if ( 'post' === get_post_type() ) {
               $the_time = get_post_time( 'His' );
               $the_modified = get_post_modified_time( 'His' );
   
               $last_modified =  sprintf( __( 'Last updated %s', 'Divi' ), esc_html( get_post_modified_time( 'M j, Y' ) ) );
   
               $published =  sprintf( __( 'Published on %s', 'Divi' ), esc_html( get_post_time( 'M j, Y' ) ) );
   
               $date = $the_modified !== $the_time ? $last_modified . ' | ' .  $published : $published;
   
               return $date;
   
           }
       }
   
       add_action( 'get_the_date', 'et_last_modified_date_blog' );
       add_action( 'get_the_time', 'et_last_modified_date_blog' );
       ```
   
 * Is there a condition I can use to have this turn off for AMP?
 *  Plugin Author [Weston Ruter](https://wordpress.org/support/users/westonruter/)
 * (@westonruter)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/line-error-shown-with-wp_debug/#post-10799730)
 * Your snippet should look like this instead: [https://gist.github.com/westonruter/428d2bc4c643873d0f476b03fb52f526](https://gist.github.com/westonruter/428d2bc4c643873d0f476b03fb52f526)
 * It is important to always return a value from a filter and in the case of filtering
   the date, never modify it if the Unix timestamp (the integer of seconds since
   1970) is requested.
 *  Thread Starter [Jonah Brown](https://wordpress.org/support/users/fishbaitbytes/)
 * (@fishbaitbytes)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/line-error-shown-with-wp_debug/#post-10799863)
 * Thanks for helping with this, I also found the templates folder in your plugin.
   Which is perfect since I wanted to change what the text says as well 🙂

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

The topic ‘Line error shown with WP_debug’ is closed to new replies.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Jonah Brown](https://wordpress.org/support/users/fishbaitbytes/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/line-error-shown-with-wp_debug/#post-10799863)
 * Status: resolved