Skip to content

Instantly share code, notes, and snippets.

@bsitruk
Last active November 20, 2015 15:56
Show Gist options
  • Select an option

  • Save bsitruk/7bfaafbbb9cdd47a855f to your computer and use it in GitHub Desktop.

Select an option

Save bsitruk/7bfaafbbb9cdd47a855f to your computer and use it in GitHub Desktop.
Date manipulation
var tenDaysAgo = new Date( now.getFullYear(), now.getMonth(), now.getDate() - 10); // Negative date works !!
var negativeDate = new Date(2015, 10, -1); // 30 Octobre 2015
var elappsedTime = Date.now() - tenDaysAgo; // Soustraire deux dates utilisent automatiquement les timeStamps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment