Sporkinator

isLeapYear()

Apr 20th, 2012
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     This script returns whether or not the given year is a Leap Year.
  3.     Leap Years are every 4 years, except for centurial years not evenly
  4.     divisible by 400.
  5. */
  6.  
  7. var year;
  8. year = argument0;
  9. return ((year mod 4 == 0 && year mod 100 != 0) || (year mod 400 == 0));
Advertisement
Add Comment
Please, Sign In to add comment