开发者

How to get total number of days in a month based on year?

开发者 https://www.devze.com 2023-02-05 11:19 出处:网络
I am using a drop down lists for selecting the month and year in .aspx page. I have to get last date of the selected month of particular selected year in .aspx.cs page开发者_JAVA技巧. (some months hav

I am using a drop down lists for selecting the month and year in .aspx page. I have to get last date of the selected month of particular selected year in .aspx.cs page开发者_JAVA技巧. (some months have 30 days and some have 31 days)

How can I do this?

Regards,

N.SRIRAM


You can use:

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


System.DateTime.DaysInMonth this should help you.

0

精彩评论

暂无评论...
验证码 换一张
取 消