日期显示问题
我写了这么一段代码:protected void Page_Load(object sender, EventArgs e)
{
label1.Text = "欢迎您,今天是 " + DateTime.Now.Year+ "年 "+DateTime.Now.Month+ "月 "+DateTime.Now.Day+ "日 "+ " "+DateTime.Now.DayOfWeek;
}来调用时间,但是表示星期只能是英文,我想用中文,有什么办法可以解决吗?用c#中的枚举也许可以,但是我不会写,请高手指教,谢谢
------解决方案--------------------自己转换一下啊。
private string date(DateTime d)
{
string str = d.DayOfWeek.ToString();
string dates = " ";
switch (str)
{
case "Monday ": dates = "星期一 "; break;
case "Tuesday ": dates = "星期二 "; break;
case "Wednesday ": dates = "星期三 "; break;
case "Thursday ": dates = "星期四 "; break;
case "Friday ": dates = "星期五 "; break;
case "Saturday ": dates = "星期六 "; break;
case "Sunday ": dates = "星期日 "; break;
}
return dates;
}