Example #1
0
        /// <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));
            }
        }