int time = 1234567891;(数据库中的存储的秒数)
DateTime BaseDateTime = new DateTime(1970, 1, 1);
DateTime ValidityDateTime = BaseDateTime.AddSeconds(timeSpan);
DateTime NowDateTime = DateTime.Now;
TimeSpan subtractSpan = NowDateTime - ValidityDateTime;
?
?
.DateTime dt1 = DateTime.Now; 2 DateTime dt2 = DateTime.Now.AddDays(-7); 3 TimeSpan ts = dt1 - dt2; 4 5 int days = ts.Days; //dt1和dt2相差多少天 6 7 eg2. 8 //编辑月份和系统登录月份是否相等 9 if(Convert.ToDateTime(DateTime.Now.ToShortDateString()).Month==Convert.ToDateTime(this.GetQueryString("sdate")).Month) 10 { 11 TimeSpan ts=Convert.ToDateTime(DateTime.Now.ToShortDateString())-Convert.ToDateTime(this.GetQueryString("