public static bool TryParseDate(string input, out DateTimeOffset result) { return(HttpRuleParser.TryStringToDate(input, out result)); }
public static string FormatDate(DateTimeOffset dateTime) { return(HttpRuleParser.DateToString(dateTime)); }
// Add the given parameter to the list. Remove if date is null. private void SetDate(string parameter, DateTimeOffset?date) { var dateParameter = NameValueHeaderValue.Find(_parameters, parameter); if (date == null) { // Remove parameter if (dateParameter != null) { _parameters.Remove(dateParameter); } } else { // Must always be quoted var dateString = string.Format(CultureInfo.InvariantCulture, "\"{0}\"", HttpRuleParser.DateToString(date.Value)); if (dateParameter != null) { dateParameter.Value = dateString; } else { Parameters.Add(new NameValueHeaderValue(parameter, dateString)); } } }