How to get the total number of days per month for a year?

I use drop-down lists to select the month and year on the .aspx page. I should get the last date of the selected month of the selected year selected on the .aspx.cs page. (some months have 30 days, and some 31 days).

How can i do this?

Hello,

N.SRIRAM

+4
source share
2 answers

You can use:

System.DateTime.DaysInMonth (int year, int month)

+12
source

System.DateTime.DaysInMonth this should help you.

+5
source

Source: https://habr.com/ru/post/1336282/


All Articles