Home > JavaScript > Leap year

Leap year

January 31st, 2015 Leave a comment Go to comments

Here’s an Javascript example how to check if a year is leap r not:

var isLeap = (((cYear%4)==0) || (((cYear%100)!=0) && ((cYear%400)==0)));

Where cYear variable where is stored the year number.

Categories: JavaScript Tags:
  1. No comments yet.
  1. No trackbacks yet.