Skip to content

Instantly share code, notes, and snippets.

@christiearcus
Last active March 16, 2016 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiearcus/19e857488b627d2836f7 to your computer and use it in GitHub Desktop.
Save christiearcus/19e857488b627d2836f7 to your computer and use it in GitHub Desktop.
Date Method
// https://gist.github.com/epoch/309e4a021cd06f8ae32b#file-js-day2-else-if-md
console.log('date.js is alive');
var n = new Date();
var year = n.getFullYear();
if (year === 2015) {
console.log('Im in the present');
}
else if (year < 2015) {
console.log('Whoa! Blast from the past!');
}
else if (year > 2015) {
console.log('Greetings from the future!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment