Exemple #1
0
 public static object GetAge(object x)
 {
     if (IsType.DateTime(x))
     {
         return(((DateTime)x).GetAge());
     }
     return(null);
 }
Exemple #2
0
 public static object AddYears(object x, object y)
 {
     if (!IsType.AnyInt(y))
     {
         return(null);
     }
     if (IsType.DateTime(x))
     {
         return(((DateTime)x).AddYearsSafe(Integers.ToInteger(y)));
     }
     return(null);
 }
Exemple #3
0
 public static object AddDays(object x, object y)
 {
     if (!IsType.AnyDouble(y))
     {
         return(null);
     }
     if (IsType.DateTime(x))
     {
         return(((DateTime)x).AddDaysSafe(Doubles.ToDouble(y)));
     }
     return(null);
 }
Exemple #4
0
 public static object ToYears(object x)
 {
     if (IsType.TimeSpan(x))
     {
         return(((TimeSpan)x).ToYears());
     }
     if (IsType.DateTime(x))
     {
         return(new TimeSpan(((DateTime)x).Ticks).ToYears());
     }
     return(null);
 }
Exemple #5
0
 public static object GetDay(object x)
 {
     if (IsType.DateTime(x))
     {
         return(((DateTime)x).GetDay());
     }
     if (IsType.TimeSpan(x))
     {
         return(((TimeSpan)x).Days);
     }
     return(null);
 }