/// <summary> /// 获取当前时间是周几 /// </summary> /// <returns></returns> public string GetWeek(DateTime? dt = null) { if (!dt.HasValue) dt = DateTime.Now; var weeks = new[] { "周日", "周一", "周二", "周三", "周四", "周五", "周六" }; return weeks[Convert.ToInt32(dt.Value.DayOfWeek)]; }