时间比较

  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;
       }
posted @ 2011-05-24 20:19  放哨De老鼠  阅读(243)  评论(0编辑  收藏  举报