时间比较
public static string fromNowToTheDate(DateTime theDate)
{
string FromNowToTheDate = "";
DateTime d1 = DateTime.Now;
DateTime d2 = theDate;
TimeSpan d3 = d2.Subtract(d1);
FromNowToTheDate = d3.Days.ToString() + "天" + d3.Hours.ToString() + "小时" + d3.Minutes.ToString() + "分钟" + d3.Seconds.ToString() + "秒";
return FromNowToTheDate;
}
{
string FromNowToTheDate = "";
DateTime d1 = DateTime.Now;
DateTime d2 = theDate;
TimeSpan d3 = d2.Subtract(d1);
FromNowToTheDate = d3.Days.ToString() + "天" + d3.Hours.ToString() + "小时" + d3.Minutes.ToString() + "分钟" + d3.Seconds.ToString() + "秒";
return FromNowToTheDate;
}