Exchange Team Blog, Dave Winer and a pubDate

Well, this morning the Exchange team blog was announced on KC's feed, which is fantastic.  Hopefully, I can send a few OWA tips that way.  I guess we will have to wait and see. 

This afternoon I attended a talk by Dave Winer at MS.  It was my first time seeing Dave in person after having read DaveNet since 95 or so.  I was hoping to see Dare there to see if he'd bring up any of this.  Lots of laptops in audience with various editors open.  A Movable Type in front of me, a .Text to the left. 

As Dave talked about his hopes for a day when RSS renders television's influence over politics impotent, I kept thinking that the interesting thing about RSS is the exhaustive degree to which people are trying to apply this technology.  What is it about this particular XML application that makes people want to see if it will work with X, where X is anything from journaling to headlines to campaign politics to selling books to calendaring to MP3 streaming?

This evening I was in such a “RSS is cool” state of mind that I finally got down to fixing some bugs in my own hoops feed.  I had been using a <dc:date> in place of a <pubDate> on my items solely because I felt the RFC822 date format was irritating.  Worked just fine inside SharpReader, but I have recently switched back to RSS Bandit which seems to ignore the dc:date.  Anyhow, I bit the bullet and whipped out this.  I am so lame for not doing it earlier.

private static string GetRfc822DateString(DateTime dt)
return string.Format("{0:ddd}, {0:dd} {0:MMM} {0:yyyy} {0:hh}:{0:mm}:{0:ss} GMT", dt.ToUniversalTime());

Comments (5)

  1. brady gaster says:

    Oh wow. This part of RSS gen is so stinkin’ frustrating. Thanks for posting this! (if only it’d been a year ago, an elegant solution my good sir!)

  2. Lance says:

    One recommendation. Unless you live in the GMT timezone, this will result in an inaccurate date unless you do one of the following:

    Convert the date into Universal Time (A.K.A. GMT) before calling the function:

    string dateString = GetRfc822DateString(mydate.ToUniversalTime());

    OR, since your function name is "Get…" not "Format…" it implies that the function should handle it, such as:

    private static string GetRfc822DateString(DateTime dt)


    DateTime tmpDate = dt.ToUniversalTime();

    return string.Format("{0:ddd}, {0:dd} {0:MMM} {0:yyyy} {0:hh}:{0:mm}:{0:ss} GMT", tmpDate);



  3. Tosh Meston says:

    Yep. I had a feeling someone would point that out. 😉

  4. Luc Cluitmans says:

    Eh, doesn’t that just work during mornings? AFAIK RFC 822 requires a 24 hour clock, so that would be a {0:HH} instead of a {0:hh}, isn’t it?

    That being said, wouldn’t

    DateTime dt2 = dt.ToUniversalTime();

    return String.Format("{0} GMT",


    "ddd, dd MMM yyyy HH:mm:ss",


    be even better? I would consider the single format string more readable. And the explicit DateTimeFormat ensures you will get the correct result even when you run the code on a machine whose locale isn’t english …

  5. Tosh Meston says:

    Even better.

Skip to main content