Created
May 2, 2020 11:53
-
-
Save pratikagashe/74a9468108008c4d70e4f39cca0238ca to your computer and use it in GitHub Desktop.
Common date format method
This file contains hidden or 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
const d = new Date() | |
const date = d.getDate() | |
const month = d.getMonth() | |
const year = d.getFullYear() | |
return date + '/' + (month + 1) + '/' + year | |
// which will return somethig like 2/5/2020 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment