skip to Main Content

How to get all dates in the last X months – Asp.net

I want to get all dates in the last three months, so I did the following: protected void BindPermissions(int empNum) { var permPeriod = new Dictionary<int, int>(); permPeriod.Add(DateTime.Now.Year, DateTime.Now.Month); permPeriod.Add(DateTime.Now.AddMonths(-1).Year, (DateTime.Now.AddMonths(-1).Month)); permPeriod.Add(DateTime.Now.AddMonths(-2).Year, (DateTime.Now.AddMonths(-2).Month)); var dt = payload_object.AttendancePermissionBO.permissionList .Where(x => x.empNum…

VIEW QUESTION
Back To Top
Search