C#获取一周的工作日显示(星期几)
|
admin
2021年1月28日 16:10
本文热度 2456
|
代码如下:
gridBandW1.Caption = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
gridBandW2.Caption = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.AddDays(1).DayOfWeek);
gridBandW3.Caption = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.AddDays(2).DayOfWeek);
gridBandW4.Caption = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.AddDays(3).DayOfWeek);
gridBandW5.Caption = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.AddDays(4).DayOfWeek);
gridBandW6.Caption = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.AddDays(5).DayOfWeek);
gridBandW7.Caption = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.AddDays(6).DayOfWeek);
该文章在 2021/1/28 16:10:38 编辑过