返回首页

我想通过querystring的日期和时间,我写了下面的代码:


 string dateTime = Request.QueryString["DateStarted"];

            DateTime dt = Convert.ToDateTime(dateTime);

            Response.Write(dt.ToString());

但我得到错误的日期。它需要由默认的DateTime 1/1/0001 12:00:00 AM。
我的实际日期是这个2011年8月19日05:55 PM

所以,我怎么能得到确切的日期值。
thanx

回答

评论会员:游客 时间:2012/02/04
Prera​​k帕特尔
]
评论会员:Rahul.KumarSharma 时间:2012/02/04
使用下面的代码发送的查询字符串:{C}
,为retrival:
DateLabel.Text= Request.QueryString["Date"];