How to find last date in current month

How to find the last date in current month ?

Example
if today is 11 March 2020
I want output 31 March 2020

Help me please.

1 Like

DateTimeVar = New DateTime(now.Year, now.Month, DateTime.DaysInMonth(now.Year, now.Month))
try this
@fairymemay

5 Likes

thank you

1 Like

Cheers
@fairymemay
Happy Learning

You can also use this

DateTime.DaysInMonth(Year, Month).ToString() to find the last date of the month

Example :strDay=DateTime.DaysInMonth(2020, 3).ToString()

1 Like

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