RSS Time Incorrect

Home Forums Calendar Products Events Calendar PRO RSS Time Incorrect

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #769407
    mjinchoe
    Participant

    I am starting a new ticket based on the postings here: https://tri.be/support/forums/topic/rss-time-showing-incorrectly/

    The issue is that the time in the RSS events feed is not getting adjusted based on the WordPress timezone settings so it shows incorrectly on the feed. For example, the timezone is set to UTC-7 but pubDate looks like the following: <pubDate>Fri, 26 Sep 2014 09:00:00 +0000</pubDate> which makes it show as 2:00am on the feed.

    I have completed the testing for conflicts with no errors or resolution. Right now our test site is set on 2011 theme with only one plugin active (login plugin) outside of the event calendar but I had deactivated it to test. I can Private Message a login for the site.

    #775773
    Brian
    Member

    Hello,

    Thanks for providing the information. I took a look at your event list and then the feed xml.

    I was able to match the next 4 events with both date and times and to their publication dates in the feed. Everything looked correct there.

    When you say:

    The rss shows <pubDate>Fri, 26 Sep 2014 09:00:00 +0000</pubDate> but it displays as 2:00AM.

    Where does it show as 2am is it another program?

    Snippet
    Also you tried the snippet below to correct the timezone, but said it was not working and killing the rss.

    https://tri.be/support/forums/topic/rss-feed-time-showing-incorrectly/%5D

    What error were you getting? In your error logs?

    Let me know what you find out and we can go from there.

    Thanks

    #776032
    mjinchoe
    Participant

    I am trying to use the event rss feed to create an automated event update email in Mailchimp. The times show correctly on the site but when using the rss feed in say Firefox or via mailchimp it shows a different time. Seems like it is not being adjusted for the wordpress timezone settings.

    Event with correct time on website at 9:00am: http://nswparents.net/event_debug/event_website.jpg

    RSS Feed in firefox shows same event as 2:00am: http://nswparents.net/event_debug/eventfeed_firefox.jpg

    RSS Feed pulled into Mailchimp shows same event as 5:00am: http://nswparents.net/event_debug/eventfeed_mailchimp.jpg

    I will send a separate post re: the snippet.

    #776086
    mjinchoe
    Participant

    In using the snippet from https://tri.be/support/forums/topic/rss-feed-time-showing-incorrectly/ , I get the following error when it gets to the <pubDate> of the first event in the feed (this is WP’s default 2011 theme and get same error our EarlyTouch theme):
    <pubDate><br />
    <b>Fatal error</b>: Uncaught exception ‘Exception’ with message ‘DateTimeZone::__construct(): Unknown or bad timezone ()’ in /home3/nswblog/public_html/test/wp-content/themes/twentyeleven/functions.php:626
    Stack trace:
    #0 /home3/nswblog/public_html/test/wp-content/themes/twentyeleven/functions.php(626): DateTimeZone->__construct(”)
    #1 [internal function]: events_rss2_gmt_pubdate_correction(‘2014-10-01 00:0…’, ‘Y-m-d H:i:s’, true)
    #2 /home3/nswblog/public_html/test/wp-includes/plugin.php(192): call_user_func_array(‘events_rss2_gmt…’, Array)
    #3 /home3/nswblog/public_html/test/wp-includes/general-template.php(1880): apply_filters(‘get_post_time’, ‘2000-08-22 07:0…’, ‘Y-m-d H:i:s’, true)
    #4 /home3/nswblog/public_html/test/wp-includes/feed-rss2.php(75): get_post_time(‘Y-m-d H:i:s’, true)
    #5 /home3/nswblog/public_html/test/wp-includes/template.php(501): require_once(‘/home3/nswblog/…’)
    #6 /home3/nswblog/public_html/test/wp-includes/functions.php(1127): load_template(‘/home3/nswblog/…’)
    #7 [internal function]: do_feed_rss2(f in <b>/home3/nswblog/public_html/test/wp-content/themes/twentyeleven/functions.php</b> on line <b>626</b><br />

    #776164
    Brian
    Member

    From what I see the pubdate is correct in the actual xml feed on your site and in a test site I have.

    Then in Firefox, IE, and for you in Mailchimp when it reads the pubdate is wants to subtract 4 hours from the time.

    So the data coming from WordPress is correct, it is the program reading the xml data that is either doing it wrong or picking up something in the xml causing it to subtract 4 hours or more.

    From what I saw in the xml data does not have anything that would tell it to offset the time. So I am going to look into it more.

    Can you try saving another timezone, instead of the utc could you try the city in your timezone and see if that enables the filter to work.

    I will let you know as soon as I have something, thanks.

    #776371
    mjinchoe
    Participant

    I updated WP timezone setting to Los Angeles and it had no effect.

    #777923
    Brian
    Member

    Hi,

    I looked into this more and was able to reproduce the error you were getting in the rss filter.

    I modified the coding here:

    https://gist.github.com/jesseeproductions/8776fc45363f674d6ae6

    I changed the first check of $zone to prevent the error.

    I am not sure if it will work with UTC time, but if you change the timezone to L.A. I believe it should fix the issue.

    Let me know if that works for you.

    Thanks

    #778896
    mjinchoe
    Participant

    Thanks for your attention to this. The new code did not throw an error but the time unfortunately is still incorrect. After some more digging, I don’t think this is a event calendar bug. Yes, the rss time is still wrong so I need to find a fix but I just noticed that the publication time on the main WordPress feed is also wrong. All the times are off by 7 hours earlier. I checked the server timezone and it is set to America/Chicago so that can’t be it. The timezone setting in WordPress is set to Los Angeles. I am at a loss. Unfortunately, it makes using the Event Calendar a problem. If the time offset issue is not solvable, maybe there is a another way to show just the date with no time in the RSS feed in the description or something. I can have Mailchimp not use the pubDate but would like to have the event date somehow included with the posting. THoughts?

    #778905
    mjinchoe
    Participant

    If WordPress for some reason is not pulling the timezone in the WP database, can we just hardcode it into the snippet you made? I know this is not optimal as a fix for everyone but perhaps worth a try.

    #778924
    mjinchoe
    Participant

    Wait hold the presses! Your code did fix it (I think … still testing). Just realized I updated our custom theme and not the WP 2011 theme we changed it to for the debugging.

    #778950
    mjinchoe
    Participant

    Ok, it is officially fixed with your code on github. Everyone, Brian from Modern Tribe / Event Calendar rocks!

    #780376
    Brian
    Member

    Great, glad it works.

    You could hardcode the Timezone if you wanted to, but as you said it may not be for everyone to do that.

    I am going to go ahead and close this ticket, but if you need any other on something else please post a new ticket.

    If you have a few minutes to spare could you please review The Events Calendar on WordPress.org

    Thanks

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘RSS Time Incorrect’ is closed to new replies.