Skip to content

Instantly share code, notes, and snippets.

@pbojinov
Last active April 8, 2018 02:33
Show Gist options
  • Save pbojinov/4b71b9e2217c93641855bcab5c9fad20 to your computer and use it in GitHub Desktop.
Save pbojinov/4b71b9e2217c93641855bcab5c9fad20 to your computer and use it in GitHub Desktop.
var DateTime = luxon.DateTime;
var then = DateTime.fromISO('2017-07-04T15:16:14.000Z');
var now = DateTime.local();
var diff = then.diff(now, 'days');
diff.toObject(); // => {days: 150.30536171296296} || diff.as('days') => 150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment