Simple JavaScript function that calculates your birthday day of week:
function getBirthday(myDay) { var daysOfWeek = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; //array with the days of week alert("I was born in a: " + daysOfWeek[myDay.getDay()]); //getDay returns the days of week (0-6 day of week. 0 == sunday) } var myDay = new Date(1969,10,25); getBirthday(myDay);
Last Comments