public static System.DateTime ToDate(System.String AValue)
        {
            CultureInfo provider = CultureInfo.InvariantCulture;

            if (AValue != null && AValue.Length == 8)
            {
                return(DateTime.ParseExact(AValue, "MM/dd/yy", provider));
            }
            else if (!(AValue == System.String.Empty) && (DateUtils.IsValid(AValue)))
            {
                return(DateTime.ParseExact(AValue, "dd/MM/yyyy", provider));
            }
            else
            {
                return(DateTime.ParseExact("01/01/1800", "dd/MM/yyyy", provider));
            }
        }
        public static System.DateTime ToDateFim(System.String AValue)
        {
            CultureInfo provider = CultureInfo.InvariantCulture;

            if (!(AValue == System.String.Empty) && (DateUtils.IsValid(AValue)))
            {
                DateTime temp = DateTime.ParseExact(AValue, "dd/MM/yyyy", provider);
                temp = temp.AddHours(23);
                temp = temp.AddMinutes(59);
                temp = temp.AddSeconds(59);
                return(temp);
            }
            else
            {
                return(DateTime.ParseExact("01/01/2250", "dd/MM/yyyy", provider));
            }
        }
Esempio n. 3
0
 public static System.Boolean IsValid(System.DateTime AValue)
 {
     return(DateUtils.IsValid(Convert.ToString(AValue)));
 }