static private TryParseExact ( String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style, DateTime &result ) : bool | ||
s | String | |
format | String | |
dtfi | DateTimeFormatInfo | |
style | DateTimeStyles | |
result | DateTime | |
Résultat | bool |
public static bool TryParseExact( ReadOnlySpan <char> input, ReadOnlySpan <char> format, IFormatProvider?formatProvider, DateTimeStyles styles, out DateTimeOffset result) { styles = ValidateStyles(styles, nameof(styles)); bool parsed = DateTimeParse.TryParseExact(input, format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out DateTime dateResult, out TimeSpan offset); result = new DateTimeOffset(dateResult.Ticks, offset); return(parsed); }
public static bool TryParseExact(string input, string format, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result) { TimeSpan span; System.DateTime time; styles = ValidateStyles(styles, "styles"); bool flag = DateTimeParse.TryParseExact(input, format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out time, out span); result = new DateTimeOffset(time.Ticks, span); return(flag); }
public static Boolean TryParseExact(String input, String format, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result) { styles = ValidateStyles(styles, "styles"); TimeSpan offset; DateTime dateResult; Boolean parsed = DateTimeParse.TryParseExact(input, format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out dateResult, out offset); result = new DateTimeOffset(dateResult.Ticks, offset); return(parsed); }
public static bool TryParseExact([NotNullWhen(true)] string?input, [NotNullWhen(true)] string?format, IFormatProvider?formatProvider, DateTimeStyles styles, out DateTimeOffset result) { styles = ValidateStyles(styles, nameof(styles)); if (input == null || format == null) { result = default; return(false); } bool parsed = DateTimeParse.TryParseExact(input, format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out DateTime dateResult, out TimeSpan offset); result = new DateTimeOffset(dateResult.Ticks, offset); return(parsed); }
public static Boolean TryParseExact(String input, String format, IFormatProvider formatProvider, DateTimeStyles styles, out DateTimeOffset result) { styles = ValidateStyles(styles, nameof(styles)); if (input == null) { result = default(DateTimeOffset); return(false); } TimeSpan offset; DateTime dateResult; Boolean parsed = DateTimeParse.TryParseExact(input.AsReadOnlySpan(), format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out dateResult, out offset); result = new DateTimeOffset(dateResult.Ticks, offset); return(parsed); }
public static bool TryParseExact(string s, string format, IFormatProvider provider, DateTimeStyles style, out DateTime result) { DateTimeFormatInfo.ValidateStyles(style, "style"); return(DateTimeParse.TryParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), style, out result)); }