Browse By

Leap year check in C#/Javascript

The easiest way to check if the year supplied to your app is a leap one just execute the if statement below

if( Year % 400 == 0 || ( Year % 4 == 0 && Year % 100 != 0 ) ) {}

 

Leave a Reply

Your email address will not be published. Required fields are marked *