End of month date

Good morning everybody
How can I detect the date of the last day of the current month

I already managed to detect the current date and I would only miss this other data

Dim MyDate As Date = Now
Dim DaysInMonth As Integer = Date.DaysInMonth(MyDate.Year, MyDate.Month)
Dim LastDayInMonthDate As Date = New Date(MyDate.Year, MyDate.Month, DaysInMonth)

I do not understand

LastDayInMonth = New Date(Now.Year, Now.Month, Now.DaysInMonth(Now.Year, Now.Month)).Day

or just:

LastDayInMonth = Now.DaysInMonth(Now.Year, Now.Month)

1 Like

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