方法一:
DateTime FirstDay = new DateTime(DateTime.Now.Year,DateTime.Now.Month,1);
DateTime LastDay = new DateTime(DateTime.Now.AddMonths(1).Year,DateTime.Now.AddMonths(1).Month,1).AddDays(-1);
方法二:
DateTime FirstDay = DateTime.Now.AddDays(-DateTime.Now.Day+1);
DateTime LastDay = DateTime.Now.AddMonths(1).AddDays(-DateTime.Now.AddMonths(1).Day);
沒有留言:
張貼留言