public static object GetAge(object x) { if (IsType.DateTime(x)) { return(((DateTime)x).GetAge()); } return(null); }
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); }
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); }
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); }
public static object GetDay(object x) { if (IsType.DateTime(x)) { return(((DateTime)x).GetDay()); } if (IsType.TimeSpan(x)) { return(((TimeSpan)x).Days); } return(null); }