Created
May 16, 2020 16:59
-
-
Save gatheluck/a1c6aef75240a711e876ab42aa06adb3 to your computer and use it in GitHub Desktop.
test date module of js.
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
var checkoutDate = new Date(2020, 5, 1) | |
checkoutDate.setDate( checkoutDate.getDate() + 365); | |
const year = checkoutDate.getFullYear(); | |
const month = checkoutDate.getMonth() + 1; | |
const date = checkoutDate.getDate(); | |
const day = checkoutDate.getDay(); | |
const formatDay = year+"/"+month+"/"+date; | |
console.log(formatDay) | |
console.log(day) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment