How to get previous month last date
current date 2020-02-27
previous month date 2020-01-31
How to get previous month last date
current date 2020-02-27
previous month date 2020-01-31
Hi,
Hope the following expression helps you.
new DateTime(now.Year,now.Month,1).AddDays(-1)
Regards,
Hi,
Can you try the following?
New DateTime(now.Year,now.Month,1).AddDays(-1).toString("MM/dd/yyyy")
Regards,
if only previous month and year needed then use
Datetime.Today.addmonth(-1).month.tostring - for month
Datetime.Today.addmonth(-1).year.tostring - for year
Regards
Shanmukh
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.