Answers for "check if a date is more than 18 years javascript"

0

check if a date is more than 18 years javascript

function isOverEighteen(year, month, day) {
  var now = parseInt(new Date().toISOString().slice(0, 10).replace(/-/g, ''));
  var dob = year * 10000 + month * 100 + day * 1; // Coerces strings to integers

  return now - dob > 180000;
}
Posted by: Guest on April-21-2021

Code answers related to "check if a date is more than 18 years javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language