public void FreshDateTime() { string strWeek = string.Empty; #region 格式化星期 switch (DateTime.Now.DayOfWeek) { case DayOfWeek.Sunday: strWeek = "星期日"; b ...
public void FreshDateTime()
{
string strWeek = string.Empty;
#region 格式化星期
switch (DateTime.Now.DayOfWeek)
{
case DayOfWeek.Sunday:
strWeek = "星期日";
break;
case DayOfWeek.Monday:
strWeek = "星期一";
break;
case DayOfWeek.Tuesday:
strWeek = "星期二";
break;
case DayOfWeek.Wednesday:
strWeek = "星期三";
break;
case DayOfWeek.Thursday:
strWeek = "星期四";
break;
case DayOfWeek.Friday:
strWeek = "星期五";
break;
case DayOfWeek.Saturday:
strWeek = "星期六";
break;
default:
strWeek = string.Empty;
break;
}
#endregion
this.labTimeNow.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ") + strWeek;
}