torsten's .NET blog In the end, everything is a gag [Ch. Chaplin]
# Tuesday, May 13, 2003
again and again
It should be business as usual that aggregators support date/time informations on RSS feed items. But on RSS 0.91 it is completely missed, newer versions (should) have at least the pubDate element. Some also support the dublin core element date formatted as xsd:dateTime. Some use the US-centric (day-of-week, DD month-name CCYY hh:mm:ss zone, aka RFC822 or RFC2822) other the ISO format (CCYY-MM-DDThh:mm:ssTZD). As the whole format is XML one may expect to get dates in the XMLSchema format (ISO). Who knows? We are on the WWW, why not use the HTTP date (day-of-week, DD month-name CCYY hh:mm:ss GMT) defined in RFC2616 as a RFC1123-date? Or some of the specific database datetime formats?
Enough confusing...
So I am lucky with Don's RSS 2.0 Profile in general, but not in the special case of date format: why the date SHOULD use TZ of post, MAY use GMT and not HAVE to use TZ of post? The other side of the medal: how we get the date(s) into a native .NET DateTime format? Simply use DateTime.Parse(). Well, works 75 percent. No RFC2822 support. Use XmlConvert.ToDateTime() for the ISO dates, nice again 20 percent. May be there is somewhere a (internal) function to parse HTTP dates. OK, lets start implementing the missing 5 percent. Write a class RFC822DateTime: DateTime { ... Ups! It's a structure, no inheritance, sorry. How about to extend it?
Reading over the docs about IFormatProvider (more related to convert a DateTime to a string), DateTimeFormatInfo, Calendars, CultureInfo, etc.: my head explodes! OK, try the other way and check whether it is at all possible: no RFC(2)822 support. Now it was time to write the x'th date time parser. Deterred from the quantity of code found here, thus I decided to transfer the main load of datetime parse to the RegEx class. The Ruby class Time used as a blueprint now it works well.
BTW: feel free to download/test the official RSS Bandit 1.1 Beta 5.
Technorati tags:  | 
Tuesday, May 13, 2003 7:03:35 PM (W. Europe Standard Time, UTC+01:00)    #  Comments [0]  | 
Navigation

Like RSS Bandit? Make a donation to help support its development and maintenance. As little as 1€ will help.

Make payments with PayPal - it's fast, free and secure!
On this page....
<May 2003>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

SUBSCRIBE RSS GeoURL e-mail

Search
Categories
Blogroll
[Feed] Dare Obasanjo
Dare Obasanjo aka Carnage4Life
[Feed] Clemens Vasters
[Feed] Omar Shahine
[Feed] Tom Mertens

newtelligence dasBlog 2.1.8102.813

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

WOT Notar

Join WebHost4Life.com