DateTime.DaysInMonth
[C#]
public static int DaysInMonth(
int year,
int month
);参数
year
年份。
month
月份(介于 1 到 12 之间的一个数字)。
返回值
指定 year 中 month 的天数。例如,如果 month 等于 2(表示二月),则返回值为 28 或 29,具体取决于 year 是否为闰年。
[C#]
public static int DaysInMonth(
int year,
int month
);参数
year
年份。
month
月份(介于 1 到 12 之间的一个数字)。
返回值
指定 year 中 month 的天数。例如,如果 month 等于 2(表示二月),则返回值为 28 或 29,具体取决于 year 是否为闰年。
当用户选折了年月日后
用语句 this.dateTimePicker1.Value.Month 可提取