コード例 #1
0
        public static bool TryParseExact(string?s, string?format, IFormatProvider?provider, DateTimeStyles style, out DateTime result)
        {
            DateTimeFormatInfo.ValidateStyles(style, nameof(style));

            if (s == null || format == null)
            {
                result = default;
                return(false);
            }

            return(DateTimeParse.TryParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), style, out result));
        }
コード例 #2
0
ファイル: FormatProvider.cs プロジェクト: karelz/corert
 public static Boolean TryParseDateTimeExact(String value, String format, IFormatProvider provider, DateTimeStyles styles, out DateTime result, out TimeSpan offset)
 {
     return(DateTimeParse.TryParseExact(value, format, (DateTimeFormatInfo)provider.GetFormat(typeof(DateTimeFormatInfo)), styles, out result, out offset));
 }
コード例 #3
0
 public static bool TryParseExact(ReadOnlySpan <char> s, ReadOnlySpan <char> format, IFormatProvider?provider, DateTimeStyles style, out DateTime result)
 {
     DateTimeFormatInfo.ValidateStyles(style, nameof(style));
     return(DateTimeParse.TryParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), style, out result));
 }
コード例 #4
0
 public static bool TryParseExact(string s, string format, IFormatProvider provider, DateTimeStyles style, out DateTime2 result)
 {
     DateTimeFormatInfo.ValidateStyles(style, "style");
     return(DateTimeParse.TryParseExact(s, format, DateTimeFormatInfo.GetInstance(provider), style, out result));
 }
コード例 #5
0
 public static Boolean TryParseDateTimeExact(String value, String format, IFormatProvider provider, DateTimeStyles styles, out DateTime result)
 {
     return(DateTimeParse.TryParseExact(value, format, DateTimeFormatInfo.GetInstance(provider), styles, out result));
 }