Instantly share code, notes, and snippets.

Embed
What would you like to do?
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