How to create Multiple folders with last moth dates

@balaji.S - Please try like this…

startDate = Convert.ToDateTime(New DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month-1, 1))

endDate = Convert.ToDateTime(New DateTime(System.DateTime.Now.Year, System.DateTime.Now.Month-1, System.DateTime.DaysInMonth(System.DateTime.Now.Year, System.DateTime.Now.Month-1)))

Here startDate and EndDate are of variable type “DateTime”

For Each

Create Folder
"LastMonthFolders" + item.ToString(“dd-MM-yyyy”)

My Output

Hope this helps…and I took the idea from @sarathi125 solution…credit goes to him…

2 Likes