您的位置:首页 > 其它

两个时间数据求它的相差小时,分钟等等

2011-06-22 14:56 537 查看
System.TimeSpan tsDiff = Convert.ToDateTime(BeginTime) - Convert.ToDateTime(OverTime);

int d = System.Math.Abs(tsDiff.Days);//两时间相差天数
int h = System.Math.Abs(tsDiff.Hours);//两时间相差小时数
string daytime = d + "天" + h + "小时"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐