有用记录
作者:互联网
C# 时间
1 //获取到当前周几(1~7) 2 int day = Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d")); 3 //本周开始是几号 4 string startTime = DateTime.Now.AddDays(-(day-1)).ToString("d"); 5 //本周结束是几号 6 string endTime = DateTime.Now.AddDays(7 - day).ToString("d");
标签:string,记录,DateTime,有用,ToString,几号,Now,day 来源: https://www.cnblogs.com/sky2blue/p/10522128.html