How To Check if Leap Year In C#.NET
Hello,
However, as i checked the DateTime class methods in MSDN, i found a handy tool to do the same functionality.
Cheers!
Below is a custom code i have been working to check if a year is considered as leap year.
protected bool CheckLeap(int year) { if((year%4==0&&year%100!=0)||year%400==0) { return true; } return false; }
DateTime.IsLeapYear(int year);
Source Code: How To Check if Leap Year In C#.NET
Cheers!
Comments
Post a Comment