Last active
January 6, 2017 02:05
-
-
Save calogxro/9a5798df11f1f5e4f08db028027fc79c to your computer and use it in GitHub Desktop.
js date today/yesterday
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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