Hello,
How to enter the date for the previous month?
For exemple: Start date: 01/05/2020 and the End Date: 31/05/2020
Thank you in advance
Hello,
How to enter the date for the previous month?
For exemple: Start date: 01/05/2020 and the End Date: 31/05/2020
Thank you in advance
for
last date = new DateTime(now.year,now.AddMonths(-1).Month, date.DaysInMonth(now.Year,now.AddMonths(-1).Month))
first date = new DateTime(now.year,now.AddMonths(-1).Month, 1)
Thank you so much
StartDate = new DateTime(Now.AddMonths(-1).Year, Now.AddMonths(-1).Month,1)
EndDate = (new DateTime(Now.Year,Now.Month,1)).AddDays(-1)
Your solution may be wrong for (2021/01/01)
last date = new DateTime(now.year,now.AddMonths(-1).Month, date.DaysInMonth(now.Year,now.AddMonths(-1).Month))
True, Thanks for correction
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.