Skip to content

Instantly share code, notes, and snippets.

@MoritzBuetzer
Created September 5, 2019 13:40
Show Gist options
  • Save MoritzBuetzer/0e596e53a6e84a9f3e45c3ce01ec0eec to your computer and use it in GitHub Desktop.
Save MoritzBuetzer/0e596e53a6e84a9f3e45c3ce01ec0eec to your computer and use it in GitHub Desktop.
Month and Date of JavaScript in 2 digit format
// day
("0" + dateObj.getDate()).slice(-2)
// month
("0" + (dateObj.getMonth() + 1)).slice(-2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment