Skip to content

Instantly share code, notes, and snippets.

@calogxro
Last active January 6, 2017 02:05
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 calogxro/9a5798df11f1f5e4f08db028027fc79c to your computer and use it in GitHub Desktop.
Save calogxro/9a5798df11f1f5e4f08db028027fc79c to your computer and use it in GitHub Desktop.
js date today/yesterday
now = Date.now()
today = new Date(now)
today.toLocaleDateString("it-IT", {year:'numeric', month:'2-digit', day:'2-digit'})
yesterday = new Date(now)
yesterday.setDate(yesterday.getDate() - 1)
yesterday.toLocaleDateString("it-IT", {year:'numeric', month:'2-digit', day:'2-digit'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment