Created
March 7, 2017 14:12
-
-
Save ltpitt/b04cc54882f6b8ab8456b687ca51ac36 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
// Password change timestamp | |
var int_pass_rotation = "2017-03-06"; | |
var lastPasswordUpdateDate = new Date(int_pass_rotation); | |
console.log(lastPasswordUpdateDate); | |
// GET CURRENT DATE | |
var now = new Date(); | |
console.log(now); | |
// Compare timestamp | |
var dateDelta = (now - lastPasswordUpdateDate) / (1000*60*60*24); | |
console.log(dateDelta); | |
if (dateDelta < 90) { | |
console.log("no need to change password"); | |
} else { | |
console.log("password needs to be changed"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment