static private ParseExact ( String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style ) : DateTime | ||
s | String | |
format | String | |
dtfi | DateTimeFormatInfo | |
style | DateTimeStyles | |
Résultat | DateTime |
public static DateTimeOffset ParseExact(ReadOnlySpan <char> input, ReadOnlySpan <char> format, IFormatProvider?formatProvider, DateTimeStyles styles = DateTimeStyles.None) { styles = ValidateStyles(styles, nameof(styles)); DateTime dateResult = DateTimeParse.ParseExact(input, format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out TimeSpan offset); return(new DateTimeOffset(dateResult.Ticks, offset)); }
public static DateTimeOffset ParseExact(string input, string format, IFormatProvider formatProvider, DateTimeStyles styles) { TimeSpan span; styles = ValidateStyles(styles, "styles"); return(new DateTimeOffset(DateTimeParse.ParseExact(input, format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out span).Ticks, span)); }
// Constructs a DateTimeOffset from a string. The string must specify a // date and optionally a time in a culture-specific or universal format. // Leading and trailing whitespace characters are allowed. // public static DateTimeOffset ParseExact(String input, String format, IFormatProvider formatProvider, DateTimeStyles styles) { styles = ValidateStyles(styles, "styles"); TimeSpan offset; DateTime dateResult = DateTimeParse.ParseExact(input, format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out offset); return(new DateTimeOffset(dateResult.Ticks, offset)); }
// Constructs a DateTimeOffset from a string. The string must specify a // date and optionally a time in a culture-specific or universal format. // Leading and trailing whitespace characters are allowed. // public static DateTimeOffset ParseExact(String input, String format, IFormatProvider formatProvider, DateTimeStyles styles) { styles = ValidateStyles(styles, nameof(styles)); if (input == null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.index); // TODO: index => input } TimeSpan offset; DateTime dateResult = DateTimeParse.ParseExact(input.AsReadOnlySpan(), format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out offset); return(new DateTimeOffset(dateResult.Ticks, offset)); }
// Constructs a DateTimeOffset from a string. The string must specify a // date and optionally a time in a culture-specific or universal format. // Leading and trailing whitespace characters are allowed. // public static DateTimeOffset ParseExact(string input, string format, IFormatProvider?formatProvider, DateTimeStyles styles) { styles = ValidateStyles(styles, nameof(styles)); if (input == null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.input); } if (format == null) { ThrowHelper.ThrowArgumentNullException(ExceptionArgument.format); } DateTime dateResult = DateTimeParse.ParseExact(input, format, DateTimeFormatInfo.GetInstance(formatProvider), styles, out TimeSpan offset); return(new DateTimeOffset(dateResult.Ticks, offset)); }
// Constructs a DateTime from a string. The string must specify a // date and optionally a time in a culture-specific or universal format. // Leading and trailing whitespace characters are allowed. // public static DateTime ParseExact(String s, String format, IFormatProvider provider, DateTimeStyles style) { DateTimeFormatInfo.ValidateStyles(style, "style"); return(DateTimeParse.ParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), style)); }
// Constructs a DateTime from a string. The string must specify a // date and optionally a time in a culture-specific or universal format. // Leading and trailing whitespace characters are allowed. // public static DateTime ParseExact(String s, String format, IFormatProvider provider) { return(DateTimeParse.ParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), DateTimeStyles.None)); }