Skip to content

Instantly share code, notes, and snippets.

@jcinis
Last active October 17, 2018 03:49
Show Gist options
  • Save jcinis/470180efe6526465e977caa1884f878a to your computer and use it in GitHub Desktop.
Save jcinis/470180efe6526465e977caa1884f878a to your computer and use it in GitHub Desktop.
Calculating my life in days instead of years
const moment = require("moment");
// The number of days since your birthday + 1 (so that your birthday counts as day #1)
let lifeDay = moment().diff(moment("1981-04-17"),"days") + 1;
console.log("Today is day " + lifeDay + " of my life");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment