Home › Forums › Calendar Products › Events Calendar PRO › RSS Time Incorrect
- This topic has 11 replies, 2 voices, and was last updated 11 years, 7 months ago by
Brian.
-
AuthorPosts
-
September 26, 2014 at 3:51 pm #769407
mjinchoe
ParticipantI 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.
September 29, 2014 at 7:59 am #775773Brian
MemberHello,
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
September 29, 2014 at 10:33 am #776032mjinchoe
ParticipantI 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.
September 29, 2014 at 11:19 am #776086mjinchoe
ParticipantIn 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 />September 29, 2014 at 12:10 pm #776164Brian
MemberFrom 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.
September 29, 2014 at 2:17 pm #776371mjinchoe
ParticipantI updated WP timezone setting to Los Angeles and it had no effect.
September 30, 2014 at 5:03 am #777923Brian
MemberHi,
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
September 30, 2014 at 12:22 pm #778896mjinchoe
ParticipantThanks 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?
September 30, 2014 at 12:25 pm #778905mjinchoe
ParticipantIf 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.
September 30, 2014 at 12:32 pm #778924mjinchoe
ParticipantWait 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.
September 30, 2014 at 12:40 pm #778950mjinchoe
ParticipantOk, it is officially fixed with your code on github. Everyone, Brian from Modern Tribe / Event Calendar rocks!
October 1, 2014 at 5:22 am #780376Brian
MemberGreat, 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
-
AuthorPosts
- The topic ‘RSS Time Incorrect’ is closed to new replies.
