Ejemplo n.º 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));
        }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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));
 }