I need to calculate if someone is over 18 from their date of birth using JQuery.
var curr = new Date(); curr.setFullYear(curr.getFullYear() - 18); var dob =
You could use the Date object. This will return the milliseconds between the two dates. There are 31556952000 milliseconds in a year.
function dateDiff(var now, var dob) { return now.getTime() - dob.getTime(); }