C# DateTime Subtract

DateTime start = DateTime.Now.AddDays(-20);
            DateTime end = DateTime.Now;
            TimeSpan ts = end.Subtract(start);
            double days = ts.TotalDays;

            int differentDays = (int)DateTime.Now.Subtract(start).TotalDays;

            bool result = days == differentDays;
            //输出 true
原文地址:https://www.cnblogs.com/hofmann/p/11676000.html