DateTime dt1 = new DateTime(2008,3,6,10,30,06);
DateTime dt2 = new DateTime(2008,3,9,10,30,06);
System.TimeSpan st = dt2.sSubtract(dt1);
this.TextBox1.Text = st.Days.ToString()+"天"
+st.Hours.ToString()+"小时"
+st.Minutes.ToString()+"分钟"
+st.Seconds.ToString()+"秒";
protected void Page_Load(object sender, EventArgs e)
{
DateTime dt1 = DateTime.Now;
DateTime dt2 = DateTime.Now.AddDays(3);
this.Label1.Text = dt2.ToString();
TimeSpan ts = dt2 - dt1;
int i = Convert.ToInt32(ts.TotalDays.ToString());
int j = 1;
int k=i-j;
this.Label2.Text = k.ToString();
}
DateTime dt2 = new DateTime(2008,3,9,10,30,06);
System.TimeSpan st = dt2.sSubtract(dt1);
this.TextBox1.Text = st.Days.ToString()+"天"
+st.Hours.ToString()+"小时"
+st.Minutes.ToString()+"分钟"
+st.Seconds.ToString()+"秒";
protected void Page_Load(object sender, EventArgs e)
{
DateTime dt1 = DateTime.Now;
DateTime dt2 = DateTime.Now.AddDays(3);
this.Label1.Text = dt2.ToString();
TimeSpan ts = dt2 - dt1;
int i = Convert.ToInt32(ts.TotalDays.ToString());
int j = 1;
int k=i-j;
this.Label2.Text = k.ToString();
}