Source code // Abraham Lincoln's birthday: February 12, 1809 var name = "Abraham Lincoln"; var m = 1; // January == 0 var d = 12; var y = 1809; var daynames = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); var monthabbr = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); var monthnames = new Array("January", "February", "March", "April", "May", "June", "July", "August", "Sepember", "October", "November", "December"); var d1 = new Date(y, m, d); document.writeln('Birth Date Information for ' + name + ''); document.writeln('' + monthnames[m] + ' ' + d + ', ' + y + ''); document.writeln('Month: ' + d1.getMonth() + ' (January = 0) '); document.writeln('Day: ' + d1.getDate() + ''); document.writeln('Year: ' + d1.getFullYear() + ''); document.writeln('Milliseconds since 1/1/1970: ' + d1.getTime() + ''); document.writeln('Day of week: ' + d1.getDay() + ''); document.writeln('-----------------------'); document.writeln('Day name: ' + daynames[d1.getDay()] + ''); document.writeln('Month abbreviation: ' + monthabbr[d1.getMonth()] + ''); document.writeln('Month name: ' + monthnames[d1.getMonth()] + ''); var now = new Date(); if (now.getTime() < d1.getTime()) { document.writeln('This person has not been born yet'); } else { var daysOld = Math.floor((now.getTime() - d1.getTime()) / (1000 * 60 * 60 * 24)); document.writeln('This person is ' + daysOld + ' days old'); var yearsOld = now.getFullYear() - d1.getFullYear(); if ((now.getMonth() < d1.getMonth()) || ((now.getMonth() == d1.getMonth()) && (now.getDate() < d1.getDate()))) { yearsOld--; } document.writeln('This person is (or would be) ' + yearsOld + ' years old.'); }