骄傲小公主

导航

C#比较两个时间大小

            DateTime t1 = Convert.ToDateTime("2012-12-31 23:59:00");
            DateTime t2 = Convert.ToDateTime("2013-1-1 00:01:00");
            TimeSpan ts = t2 - t1;
            int ss = Convert.ToInt32(ts.TotalMinutes);
            textBox1.Text = ss.ToString();

posted on 2014-07-05 11:42  骄傲小公主  阅读(622)  评论(2编辑  收藏  举报