1、获取星期数字 例如:周四:4
//int类型 Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d")); //string类型 DateTime.Now.DayOfWeek.ToString("d");
2、获取得到星期英文
//Sunday Monday Tuesday Wednesday Thursday Friday Saturday DateTime.Today.DayOfWeek.ToString();
3、得到文字形式
//第一种 string[] Day = new string[] { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; string week = Day[Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d"))].ToString(); //第二种: string week1 = System.Globalization.CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek);
标签:DayOfWeek,星期,string,c#,DateTime,ToString,Now From: https://www.cnblogs.com/ZhuMeng-Chao/p/17271415.html