If you want the last day of the specified month, use this:
Dim original As DateTime = DateTime.Now ' The date you want to get the last day of the month for
Dim lastOfMonth As DateTime = original.Date.AddDays(-(original.Day - 1)).AddMonths(1).AddDays(-1)
A little long, but it guarantees that you somehow will not finish with the first of the next month or the second until the last month.
source
share