Last date of previous month

how to get last date of previous month

@Ananya1 - pls try below -

lstDateOfPreMonth = New DateTime(now.Date.Year, now.Date.Month,1).AddDays(-1)

1 Like


Please use the below code with Assign activity:

var now = DateTime.Now;    
var firstDayCurrentMonth = new DateTime(now.Year, now.Month, 1);
var lastDayLastMonth = firstDayCurrentMonth.AddDays(-1);

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.