@@ -210,26 +210,28 @@ private static Dictionary<string, string> SupportedMedia
210210 /// </returns>
211211 public static string ToRfc822DateTime ( DateTime dateTime )
212212 {
213- var offset =
214- ( int ) ( TimeZone . CurrentTimeZone . GetUtcOffset ( DateTime . Now ) . TotalHours + BlogSettings . Instance . Timezone ) ;
215- var timeZone = string . Format ( "+{0}" , offset . ToString ( NumberFormatInfo . InvariantInfo ) . PadLeft ( 2 , '0' ) ) ;
216-
217- // ------------------------------------------------------------
218- // Adjust time zone based on offset
219- // ------------------------------------------------------------
220- if ( offset < 0 )
221- {
222- var i = offset * - 1 ;
223- timeZone = string . Format ( "-{0}" , i . ToString ( NumberFormatInfo . InvariantInfo ) . PadLeft ( 2 , '0' ) ) ;
224- }
225-
213+ //var offset =
214+ // (int)(TimeZone.CurrentTimeZone.GetUtcOffset(DateTime.Now).TotalHours + BlogSettings.Instance.Timezone);
215+ //var timeZone = string.Format("+{0}", offset.ToString(NumberFormatInfo.InvariantInfo).PadLeft(2, '0'));
216+
217+ //// ------------------------------------------------------------
218+ //// Adjust time zone based on offset
219+ //// ------------------------------------------------------------
220+ //if (offset < 0)
221+ //{
222+ // var i = offset * -1;
223+ // timeZone = string.Format("-{0}", i.ToString(NumberFormatInfo.InvariantInfo).PadLeft(2, '0'));
224+ //}
225+
226+ //return dateTime.ToString(
227+ // string.Format("ddd, dd MMM yyyy HH:mm:ss {0}", timeZone.PadRight(5, '0')), DateTimeFormatInfo.InvariantInfo);
226228 return dateTime . ToString (
227- string . Format ( "ddd, dd MMM yyyy HH:mm:ss {0}" , timeZone . PadRight ( 5 , '0' ) ) , DateTimeFormatInfo . InvariantInfo ) ;
229+ string . Format ( "ddd, dd MMM yyyy HH:mm:ss {0}" , BlogSettings . Instance . TimeZoneId ) , DateTimeFormatInfo . InvariantInfo ) ;
228230 }
229231
230232 static string RssDateString ( DateTime pubDate )
231233 {
232- pubDate = pubDate . AddHours ( BlogSettings . Instance . Timezone ) ;
234+ pubDate = BlogSettings . Instance . ClientTime ( pubDate ) ;
233235 var value = pubDate . ToString ( "ddd',' d MMM yyyy HH':'mm':'ss" ) + " " +
234236 pubDate . ToString ( "zzzz" ) . Replace ( ":" , "" ) ;
235237 return value ;
0 commit comments