Skip to content

Instantly share code, notes, and snippets.

@oidacra
Created January 23, 2015 22:04
Show Gist options
  • Save oidacra/a5dd7125c116549f547f to your computer and use it in GitHub Desktop.
Save oidacra/a5dd7125c116549f547f to your computer and use it in GitHub Desktop.
Calcular Edad JS
// Kristoffer Dorph
function calcAge(dateString) {
var birthday = +new Date(dateString);
return~~ ((Date.now() - birthday) / (31557600000));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment