Skip to content

Instantly share code, notes, and snippets.

@RakibSiddiquee
Created February 27, 2019 11:54
Show Gist options
  • Save RakibSiddiquee/210360187e2e37e967d98a326d71ccec to your computer and use it in GitHub Desktop.
Save RakibSiddiquee/210360187e2e37e967d98a326d71ccec to your computer and use it in GitHub Desktop.
Count age from a given birthday in Javascript.
birthday = '1987-05-04';
age = ((Date.now() - Date.parse(birthday)) / 31557600000).toFixed(1);
alert(age);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment