Date problem in Feed Manager

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
3/11/2010 10:54:07 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Date problem in Feed Manager

I have an RSS feed being generated out of Yahoo pipes. The URL for the feed is:

http://pipes.yahoo.com/pipes/pipe.run?_id=c4ec2ca51d74d8830a1b699d9f575daf&_render=rss

When I run it through the W3C RSS Validator, the pubDate for an example item is listed as:

Wed, 10 Mar 2010 19:32:52 -0800

If I run it through the Validome RSS validator (RSS 2.0, View Sourcecode checkbox marked), that same date is listed as:

Thu, 11 Mar 2010 03:32:52 +0000

However, when I consume the feed in Feed Manager, the date being shown is:

Wednesday, March 10, 2010 11:32:52 AM frown

So it looks like mojoPortal is "double correcting" the date to try and convert it to our local time zone. Any and all help would be greatly appreciated!

Thanks,
Jamie

Update: If I use a custom date string of "MM/dd/yyyy hh:mm tt z", I get the following date shown:

03/10/2010 11:32 AM -8

3/11/2010 12:23:44 PM
Gravatar
Total Posts 18439

Re: Date problem in Feed Manager

Hi Jaime,

In all features of mojoPortal we store dates in UTC aka GMT time and feeds should also use GMT so that it is possible to adjust to the preferred timezone using the GMT offset.

So all features in mojoPortal adjust times from GMT to either the user's timezone offset as indicated in their user profile, or for anonymous users it uses the site default offset. So as far as I know we are correcting the time from GMT but not double correcting. If you are adjusting it from a feed processor you should adjust it to GMT and let mojoPortal adjust it to the site.

http://www.mojoportal.com/timezonelocalization.aspx

Hope it helps,

Joe

3/11/2010 2:34:46 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Date problem in Feed Manager

Hey thanks, Joe. I know that RSS feeds are supposed to be using GMT, and mine is definitely doing that. On a hunch, I took a look at the mojoPortal.com RSS feedburner feed. The date from your most recent blog post appears in the feed as:

Wed, 10 Mar 2010 18:23:26 GMT

Whereas Yahoo! pipes is outputting in a time format like this:

Wed, 10 Mar 2010 18:23:26 +0000

The top version is shown properly in my Feed Manager as 10:23 AM. So perhaps mojoPortal is not properly handling a pubDate that uses +0000/-0800 time zone specifiers?

3/12/2010 1:25:44 PM
Gravatar
Total Posts 18439

Re: Date problem in Feed Manager

Hi Jaime,

We are using the Argotic Framework to process feeds, I just checked and there isn't a newer version than what we are using. However, I think the problem may be more fundamental and not an issue with Argotic. That format does not appear like any standard date time string I've ever seen and I think it could be that the .NET class doing DateTime.Parse or TryParse may just ignore that part of the string if it doesn't understand it. If there is a way to apply string formating in Yahoo to change it from +0000 to GMT I would look into doing that.

I have not tried it but you might experiment with DateTime.Parse/TryParse on a string like that to see what result .NET produces.

Hope it helps,

Joe

3/15/2010 3:42:12 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Date problem in Feed Manager

Hey Joe, thanks for that update. I did a bit of research on the RSS side, and according to the RSS SpecificationRFC 822 Section 5 is to be used for the date format. Hard to believe that the RSS date format specification is almost 30 years old!

Anyway, RFC 822 lists "Local differential" hours as a valid method of specifying the time zone.

I did some further research on the Argotic forum, and this bug was originally reported in August 2008 (!) and has apparently not been addressed yet. Check this link:

http://argotic.codeplex.com/Thread/View.aspx?ThreadId=32981

Unfortunately, from all appearances, Argotic seems to be abandoned by the primary developer "Oppositional," and he posted a message asking for volunteers to pick up the slack last year. The hazards of open source!

So I guess that kind of leaves mojoPortal's Feed Manager in limbo for now. I'll explore Argotic's source and see if I can identify a method to fix this problem. I've narrowed it down to SyndicationDateTimeUtility.cs.

If I can give you the source code updates to fix this, would you be able to update the Argotic source and distribute new DLLs for mojoPortal? I'm not well versed on the terms of everyone's license.

Thanks again, Joe

Jamie

3/16/2010 8:08:24 AM
Gravatar
Total Posts 18439

Re: Date problem in Feed Manager

Hi Jamie,

Thanks for researching the issue. I have the Argotic source code and will try to fix it. This is not the first dependency project that has not been maintained, I've had to make bug fixes many times in projects that we depend on. If the project was being maintained I would submit a patch upstream but I do not want to take on maintaining the Argotic project for general purposes, only to solve bugs that affect mojoPortal. What I do in cases like this is maintain my own copy of the source code under svn branches/vendor.

I've already discovered how the RSS.NET project handles this kind of date format and I think I can port the solution into Argotic. We used to use RSS.NET but it does not support Atom feeds so we switched to Argotic which at the time was being maintained.

Best,

Joe

3/16/2010 9:27:19 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Date problem in Feed Manager

That's awesome Joe. Thanks a million!

Jamie

3/16/2010 10:22:17 AM
Gravatar
Total Posts 18439

Re: Date problem in Feed Manager

fyi, I was able to fix it. The fix should be in svn trunk by late tonight.

Best,

Joe

3/16/2010 10:36:07 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Date problem in Feed Manager

Hey Joe, I took a quick glance at the RSS.NET source from http://www.rssdotnet.com/, but it actually look like the date parsing is even more crude than Argotic (they just assume GMT and strip off the end of the string).

To give you a head start, I took a look at Argotic's SyndicationDateTimeUtility.cs

I think the change may be as simple as adding this to the if-else blocks in ReplaceRfc822TimeZoneWithOffset:

else if (Match(value.Substring(value.Length-4,4),"\d{4}",RegexOptions.None))

{
     return String.Format(null, "{0}+{1}:{2}", value.Substring(0,value.Length-4),value.Substring(value.Length-4,2),value.Substring(value.Length-2,2));

}
 

I haven't had a chance to test this code, but you can try it either with my pipe output, or any of the Yahoo Hot Jobs RSS feeds.

Jamie

 

 

3/16/2010 10:40:41 AM
Gravatar
Total Posts 18439

Re: Date problem in Feed Manager

Well, actually, my copy of RSS.NET is also modified to improve datetime format parsing. I had to fork it long ago to work around some datetime issues it had under Mono, so I borrowed code from my modified solution, it does not assume GMT. I have already tested it with the feed you posted in the first post of this thread.

Best,

Joe

3/16/2010 11:21:30 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Date problem in Feed Manager

Wow, Joe, you work fast! Thanks again!

Jamie

You must sign in to post in the forums. This thread is closed to new posts.