I need to Get the lastday from previous month if the day one from current month
and if the current day is other then 1st of month no need print last day.
please find the below example
Example: present day 01/03/2024 then get 29/02/2024
Example2: Present day 15/03/2024 then get 15/03/3024
Does anybody have an idea how to do this?
Thank you!
Condition: currentDate.Day = lastDayOfMonth
Then:
- Today is the last day of the month
Assign activity
Previous day= currentDate.Adddays(-1)
Else:
Do nothing
Assign -> previousMonthLastDay = If (Now.Day = 1, Now.AddDays(-1).AddMonths(-1), Now)
If
Now.Day = 1
Then
Write line -> previousMonthLastDay.ToString("dd/MM/yyyy")
Else
Now.ToString("dd/MM/yyyy")
End If
previousMonthLastDay is of DataType System.DateTime.