예제 #1
0
        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));
        }
예제 #2
0
파일: DateTime.cs 프로젝트: formist/LinkMe
        /// <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));
            }
        }