public static ParseHttpDate ( String DateString, DateTime &dtOut ) : bool | ||
DateString | String | |
dtOut | DateTime | |
Результат | bool |
internal static DateTime string2date(string S) { DateTime time; if (!HttpDateParse.ParseHttpDate(S, out time)) { throw new ProtocolViolationException(SR.GetString("net_baddate")); } return(time); }
// parse String to DateTime format. private static DateTime StringToDate(String S) { DateTime dtOut; if (HttpDateParse.ParseHttpDate(S, out dtOut)) { return(dtOut); } else { throw new ProtocolViolationException(SR.net_baddate); } }
// // extra buffers for build/parsing, recv/send HTTP data, // at some point we should consolidate // // parse String to DateTime format. internal static DateTime string2date(String S) { DateTime dtOut; if (HttpDateParse.ParseHttpDate(S, out dtOut)) { return(dtOut); } else { throw new ProtocolViolationException(SR.GetString(SR.net_baddate)); } }
string2date(String S) { if (HttpDateParse.ParseHttpDate( S, out var dtOut)) { return(dtOut); } else { throw new Exception("Invalid Date in HTTP header"); } }