public Type.TimeSpan Subtract(TimeOfDay other) { Type.TimeSpan result = BaseValue.Subtract(other.BaseValue); Type.TimeSpan microNano = new Type.TimeSpan(0, 0, 0, 0, 0, other.m_microsecond, other.m_nanosecond); return(result.Subtract(microNano)); }
/// <summary> /// Subtracts another DateTime from this instance of DateTime /// </summary> /// <param name="other"></param> /// <returns>TimeSpan equivalent of the difference</returns> public Type.TimeSpan Subtract(DateTime other) { Type.TimeSpan result = Universal.Subtract(other.Universal); result = result.Add(new Type.TimeSpan(0, 0, 0, 0, 0, 0, m_nanosecond)); if (other.m_nanosecond == 0) { return(result); } else { Type.TimeSpan microNano = new Type.TimeSpan(0, 0, 0, 0, 0, 0, other.m_nanosecond); return(result.Subtract(microNano)); } }
public TimeOfDay Subtract(Type.TimeSpan timeSpan) { return(Add(timeSpan.Negate())); }
/// <summary> /// Subtracts the specified time or duration from this instance /// </summary> /// <param name="timeSpan">An interval of time</param> /// <returns>A Date equal to the date represented by this instance /// minus the time interval represented by value</returns> public Date Subtract(Type.TimeSpan timeSpan) { return(new Date(m_base.AddDays(-timeSpan.Days))); }
/// <summary> /// Subtracts a timespan from this instance of DateTime /// </summary> /// <param name="timeSpan"></param> /// <returns>DateTime equivalent of the difference</returns> public DateTime Subtract(Type.TimeSpan timeSpan) { return(Add(timeSpan.Negate())); }