2010-08-21 66 views
0
Literal four = new Literal(); 
    string timeanddate; 
    timeanddate = DateTime.UtcNow.ToString(); 
    DateTime dt = new DateTime(); 
    dt = Convert.ToDateTime(timeanddate); 
    dt.AddHours(3); 
    four.Text = "3hr added and this gives>> " + dt.ToString(); 
    form1.Controls.Add(four); 

它應該加3到小時,但不,它就像行addhours不存在。爲什麼代碼不會在時間上添加3小時?

回答

相關問題