How to check February Days in a specific Year

How to check number of days in February in any Year?

You can use following code to check

function daysInFebruary (year){
// February has 29 days in any year evenly divisible by four,
// EXCEPT for centurial years which are not also divisible by 400.
return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}

How to use it!

var daysInFeb = daysInFebruary (2012);

alert(daysInFeb);