RSS feed breaks if timezone offset > 0

Topics: Business Logic Layer
Apr 12, 2009 at 8:21 PM
I went to the settings page and set the timezone offset to be 9 hours (it was originally set to -5). It works nice in the home page, I see that the post's dates and times get adjusted, but then when I try to use my blog's RSS feed I get a 500 error. It happens every time. If I set the offset to 0 or a negative value, everything gets back to normal.

I am using version 1.4.5 + SQL Server.
Apr 12, 2009 at 8:31 PM
This is fixed in the upcoming BE 1.5 release.

If you want to fix it for your 1.4.5 installation, it's a pretty small fix.  Recompiling the BE core code is required.

In the SyndicationHandler.cs file in the Web\HttpHandlers folder (in the BE core code), there's a SetHeaderInformation() method with the following code in it:

if (item.DateModified > lastModified)
    lastModified = item.DateModified;

Changing that code to the following should prevent this error from happening.

if (item.DateModified.AddHours(-BlogSettings.Instance.Timezone) > lastModified)
    lastModified = item.DateModified.AddHours(-BlogSettings.Instance.Timezone);