这篇文章主要介绍了ASP.NET获取两个日期之间的天数方法,需要的朋友可以参考下
DateTime startdate=DateTime.Parse("2013-11-01");
DateTime enddate = DateTime.Parse("2013-11-11");
int d = enddate.Subtract(startdate).Days;
定义开始时间startdate
结束时间enddate
使用方法Subtract得到两个时间差
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn