private string[] weekDay = { "星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; date.Text = DateTime.Today.Date.ToString("yyyy年MM月dd日"); int dayofWeek = (int)(DateTime.Now.DayOfWeek); week.Text = weekDay[dayofWeek];
另一方法:
string str = " 2011-3-18 " ;
Response.Write(Convert.ToDateTime(str).ToString( " yyyy年MM月dd日 ddd " , new System.Globalization.CultureInfo( " zh-CN " ))); // 结果:2011年03月18日 周五