Skip to content

Instantly share code, notes, and snippets.

@gavinhungry
Last active April 4, 2018 17:30
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 gavinhungry/5d27464c6e687728e04c23f6dbd6531b to your computer and use it in GitHub Desktop.
Save gavinhungry/5d27464c6e687728e04c23f6dbd6531b to your computer and use it in GitHub Desktop.
JavaScript Date formats
// because I can never remember what all of the Date output formats look like
Object.getOwnPropertyNames(Date.prototype).filter(m => m.startsWith('to')).forEach(m => {
console.log(m.padEnd(20), new Date()[m]());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment