Ejemplo n.º 1
0
 public static object GetAge(object x)
 {
     if (IsType.DateTime(x))
     {
         return(((DateTime)x).GetAge());
     }
     return(null);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }