标签:
TimeSpan ts1 = new TimeSpan();
TimeSpan ts2 = new TimeSpan();
ts1 = new TimeSpan(DateTime.ParseExact(DateTime.Now.ToString("yyyyMMdd") + "10:20", "yyyyMMdd HH:mm", System.Globalization.CultureInfo.CurrentCulture).Ticks);
ts2 = new TimeSpan(DateTime.ParseExact(DateTime.Now.ToString("yyyyMMdd") +"10:30", "yyyyMMdd HH:mm", System.Globalization.CultureInfo.CurrentCulture).Ticks);
imeSpan ts = ts1.Subtract(ts2).Duration();
ts.Hours 小时
ts.Minutes 分钟
标签:
原文地址:http://www.cnblogs.com/zh1989/p/4742431.html