How do I get the last day of a month?

0

Issue

How can I find the last day of the month in C#?

For example, if I have the date 03/08/1980, how do I get the last day of month 8 (in this case 31)?

Solution

The last day of the month you get like this, which returns 31:

DateTime.DaysInMonth(1980, 08);

Answered By – Oskar Kjellin

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More