Created
December 10, 2014 17:15
-
-
Save graham/fd0192a1f6e78351c420 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// to generate the number of days since a date | |
var days = (new Date() - new Date(2014, 7, 11)) / (1000 * 60 * 60 * 24); | |
var days_whole = Math.floor(days); | |
// in order to determine what the date is X days from now (we'll use days_whole) | |
var now = new Date(); | |
var millis_to_date = days_whole * (1000 * 60 * 60 * 24); | |
var next_date = new Date(now.getTime() + millis_to_date); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment