public static DateTime ParseRfc822DateTime(string value) { DateTime result = DateTime.MinValue; Guard.ArgumentNotNullOrEmptyString(value, "value"); if (SyndicationDateTimeUtility.TryParseRfc822DateTime(value, out result)) { return(result); } else { throw new FormatException(String.Format(null, "'{0}' is not a valid RFC-822 formatted date-time value.", value)); } }
public static DateTime ParseRfc822DateTime(string value) { //------------------------------------------------------------ // Local members //------------------------------------------------------------ DateTime result = DateTime.MinValue; //------------------------------------------------------------ // Validate parameter //------------------------------------------------------------ Guard.ArgumentNotNullOrEmptyString(value, "value"); //------------------------------------------------------------ // Parse RFC-3339 formatted date //------------------------------------------------------------ if (SyndicationDateTimeUtility.TryParseRfc822DateTime(value, out result)) { return(result); } else { throw new FormatException(String.Format(null, "'{0}' is not a valid RFC-822 formatted date-time value.", value)); } }