C#中日期相减的方法

    C#日期相减的的方法
    DateTime    t1    =    DateTime.Parse("2005-01-01");
    DateTime    t2    =    DateTime.Parse("2006-01-01");
    System.TimeSpan    ts    =    t2    -    t1;
    int    days    =    ts.Days;

posted @ 2012-12-01 16:05  奇奇博客  阅读(469)  评论(0编辑  收藏  举报