I have changed the lastmod format to ('d-m-Y h:i:s') but is still not working? only half of the sitemap feeds have changed?

Please can someone help?
Tuesday, April 12 2016, 03:22 AM
Share this post:

Accepted Answer

Thursday, April 14 2016, 01:03 AM - #Permalink
The code is not showing right here because is not wrapped with code tag so try to implement this one: https://github.com/arastta/arastta/pull/406/files
The reply is currently minimized Show
Responses (33)
  • Accepted Answer

    Tuesday, April 12 2016, 03:43 AM - #Permalink
    For whatever reason the format d-m-Y h:i:s was only used once i change them all now it works.. :) self healing...lol:D
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 04:13 AM - #Permalink
    Although that seems to work it still not accepted by google any help is welcome i need to change it to

    2013-10-21 15:56:22

    should be written

    2013-10-21T15:56:22+2.00 for it to be accepted by google
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 02:32 PM - #Permalink
    It's not easy to follow your writings, but you have changed it in /catalog/view/theme/*/template/feed/google_sitemap.tpl - right?

    Clock time isn't really needed, Google will accept Y-m-d too, last time I tested I used:
            <?php if (isset($result['date'])) { ?>
    <lastmod><?php echo date('Y-m-d', strtotime($result['date'])); ?></lastmod>
    <?php } else { ?>
    <lastmod><?php echo date('Y-m-d'); ?></lastmod>
    <?php } ?>


    But I guess it could also work with something like (not tested):
            <?php if (isset($result['date'])) { ?>
    <lastmod><?php echo date('Y-m-d', strtotime($result['date'])) . 'T' . date('H:i:s', strtotime($result['date'])) . '+2.00'; ?></lastmod>
    <?php } else { ?>
    <lastmod><?php echo date('Y-m-d') . 'T' . date('H:i:s') .'+2.00'; ?></lastmod>
    <?php } ?>


    BUT, I guess that timezone addition (+2.00) is depending on servers timezone. I would skip it ...

    EDIT! Those are the valid formats: https://www.w3.org/TR/NOTE-datetime - but only YYYY-MM-DD is required when using the optional lastmod tag: http://www.sitemaps.org/protocol.html
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 03:37 PM - #Permalink
    Thanks i will try to follow these instructions? i am not sure which one will work, will try everything :)
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 04:16 PM - #Permalink
    The second code had the same result, but the first code came up with this result.

    Warnings
    Invalid XML: too many tags
    Too many tags describing this tag. Please fix it and resubmit.
    52

    Any ideas?
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 04:19 PM - #Permalink
    Post your file ...
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 04:29 PM - #Permalink
    I will send a screen shot
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 04:32 PM - #Permalink
    Now i get this error??

    Errors
    Error
    We encountered an error while trying to access your Sitemap. Please ensure your Sitemap follows our guidelines and can be accessed at the location you provided and then resubmit.
    1
    Network unreachable: Network unreachable
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 04:33 PM - #Permalink
    Post your file (code), not link to your sitemap.
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 04:41 PM - #Permalink
    '; ?>









    weekly



    1.0










    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 04:43 PM - #Permalink
    You can't see it?
    Attachments:
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 04:52 PM - #Permalink
    To post code, you need to use the code tag around it (found in the toolbar for the text field).



    If you use caching in site or server, remember to flush it before testing changes!
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 05:37 PM - #Permalink
    OK Looking now :) but it is not what google is saying?



    Errors
    Invalid date
    An invalid date was found. Please fix the date or formatting before resubmitting.
    52
    Parent tag: url
    Tag: lastmod
    Value: 2016-04-12 01:26:20
    4
    Apr 12, 2016
    Parent tag: url
    Tag: lastmod
    Value: 2016-04-12 01:26:20
    15
    Apr 12, 2016
    Parent tag: url
    Tag: lastmod
    Value: 2016-04-12 01:26:20
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 05:39 PM - #Permalink
    1

    /index.php?route=feed/google_sitemap
    Sitemap
    Pending
    52 errors
    Web
    52
    5
    Images
    12
    -
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 05:43 PM - #Permalink
    If the file you posted is located in the template you are using, you would not get that output including time, as it doesn’t exist in that file - according to you.

    Oh, and there is no times in that link you posted earlier:

    So I really don't have any clue about what you actually are doing ...
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 05:58 PM - #Permalink
    Try

    <lastmod> . date('c', strtotime($result['date_modified'])) . </lastmod>
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 06:04 PM - #Permalink
    Something is not right with that code?

    Thanks :)
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 06:04 PM - #Permalink
    Something is not right with that code?

    Thanks :)
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 06:08 PM - #Permalink
    Bobby winters wrote:

    Something is not right with that code?

    Thanks :)

    Do you try that code above?
    As reference, you can check link below
    function date php
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, April 12 2016, 06:12 PM - #Permalink
    Sorry i am not joking it does not recognize it as complete
    The reply is currently minimized Show
Your Reply