Hi Slav,
I did a couple of changes to your original code to get it working in my context where I am parsing rss from different sources and in some case even mixed rss feeds using yahoo tubes.
The problem I was experiencing is related to culture.
Just for reference to someone else that may experience the same issues, this is what I did:
In the web.config I added a culture section in system.web:
<
globalization
culture
=
"en-US"
uiCulture
=
"en-US"
/>
and the parsing methods have been modified like this:
protected string GetDayOfWeek(string dateTimeString)
{
DateTime result = DateTime.Parse(dateTimeString, System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat);
string dayOfWeek = Enum.GetName(typeof(DayOfWeek), result.DayOfWeek);
return dayOfWeek;
}
protected string GetTimeOnly(string dateValue)
{
return System.DateTime.Parse(dateValue, System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat).ToString("hh:mm");
}
protected string GetDateOnly(string dateValue)
{
string dateOnly=System.DateTime.Parse(dateValue, System.Globalization.CultureInfo.InvariantCulture.DateTimeFormat).ToString("ddd, MMM d, yyyy");
return dateOnly;
}