In C # two time subtraction, get a TimeSpan instance, TimeSpan Some attributes: Days, Totaldays, Hours, Totalhours, Minutes, Totalminutes, Seconds, TotalSeconds, Ticks, note that there is no totalticks.
These attribute names begin to understand some difficulties, but after reading this article, you must be enlightened.
For example, Time 1 is 2010-1-2 8:43:35, time 2 is 2010-1-12 8:43:34.
With time 2 minus time 1, get a TimeSpan instance.
Then 2 times 1 more 9 days 23 hours 59 minutes 59 seconds.
Then, days is 9,hours is 23,minutes is 59,seconds is 59.
To see Ticks,tick is a time period, indicating 100 nanoseconds, that is, one out of 10,000 seconds, then Ticks here to indicate the total difference between the number of periods, namely: 9 * 24 * 3600 * 10000000 + 23 * 3600 * 10000000 + 59 * 60 * 10000000 + 59 * 10000000 = 8639990000000. 3600 is the number of seconds in an hour.
Totaldays is the Ticks conversion own number, namely: 8639990000000/(10000000 * 24 * 3600) = 9.99998842592593.
Totalhours is the conversion of Ticks into hours, that is: 8639990000000/(10000000 * 3600) = 239.999722222222.
Totalminutes is the conversion of Ticks into minutes, that is: 8639990000000/(10000000 * 60) = 14399.9833333333.
TotalSeconds is the conversion of Ticks into seconds, that is: 8639990000000/(10000000) = 863999.
Negative
The above is a late date minus an earlier date, so each property value is a positive number, and if the earlier date is a later date, the property value is negative.