DateTime dt = Convert.ToDateTime(this.TextBox1.Text); DateTime de = Convert.ToDateTime(this.TextBox2.Text); System.TimeSpan ts = dt.Subtract(de); this.Label1.Text = "天" + ts.Days.ToString() + "小时" + ts.Hours.ToString() + "秒数" + ts.Minutes.ToString() + "毫秒" + ts.Seconds.ToString();
C#日期相减
最新推荐文章于 2022-09-22 10:32:40 发布