开发者

DateTime.DaysInMonth returns 29 for feb. 2000?

i think i have a little issue, but i'm not sure, because it's either i am wrong or .Net 开发者_Go百科is wrong, and usually it is not .Net :)

but in my testscenario i did this:

DateTime.DaysInMonth(2000,2)

and it returned 29.

But as far as i know 400 years (0,400,800,1200 etc.) are not leap years?


.NET is correct: years that are divisible by 100 aren't leap years, unless they are also divisible by 400.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜