C# 获取日期星期几方法
作者:互联网
/// <summary> /// 计算日期星期几 /// </summary> /// <param name="dtNow">日期(DateTime类型)</param> /// <returns></returns> public string CaculateWeekDay(DateTime dtNow) { var weekdays = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; return weekdays[(int)dtNow.DayOfWeek]; }
标签:星期,dtNow,C#,weekdays,DateTime,日期,string 来源: https://www.cnblogs.com/yu-shang/p/12100492.html