Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter herold

    (@herold)

    Error message from Google webmaster tools:

    “An invalid date was found. Please fix the date or formatting before resubmitting.”

    Plugin Contributor pglewis

    (@pglewis)

    Can you send a link to the xml sitemap to Scott or myself to take at look at this?

    Thread Starter herold

    (@herold)

    I just checked again and I still see a yellow Explanation icon, however the error message is gone. Will check again in a few days.

    I had the same issue with WP 3.9.2 and the italian locale (WP_LANG set to it_IT),
    and the 1.0 plugin. My sitemap_index.xml looked like:

    [...]
    <sitemap>
    <loc>https://[mywebsite.com]/pods_faq-sitemap.xml</loc>
    <lastmod>2014-08-14 13:30:56</lastmod>
    </sitemap>
    [...]

    The problem is the format of the date (not UTC).
    I inserted this line in the classes/pods-seo-wpseo.php file, at line 228:
    $lastmod = gmdate("Y-m-d\TH:i:s+00:00", strtotime($lastmod));

    Then the error/warning on webmaster tools disappeared.

    Michele

    julianm

    (@julianm)

    There is an error on line 155 of version 1.0, which I found to be causing the problem.

    The code:

    if ( !empty( $lastmod ) ) {
         date( 'c', strtotime( $lastmod ) );
    }

    Should be:

    if ( !empty( $lastmod ) ) {
         $lastmod = date( 'c', strtotime( $lastmod ) );
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Error in Date / Time Stamp’ is closed to new replies.