Skip to content

Instantly share code, notes, and snippets.

@cp-sumi-k
Last active November 8, 2022 09:50
Show Gist options
  • Save cp-sumi-k/118f2ab5ca41c19dfab439b2695d135b to your computer and use it in GitHub Desktop.
Save cp-sumi-k/118f2ab5ca41c19dfab439b2695d135b to your computer and use it in GitHub Desktop.
// Current date in millis : 1667813042954
// A year after : 1699353114157
console.log("A year after : ", new Date().setYear(cDate.getFullYear() + 1))
// 3 months after : 1675765990138
console.log("3 months after : ", new Date().setMonth(cDate.getMonth() + 3))
// 2 days after : 1667990027784
console.log("2 days after : ", new Date().setDate(cDate.getDate() + 2))
// 2 hours after : 1667824456277
console.log("2 hours after : ", new Date().setHours(cDate.getHours() + 2))
// 5 minutes after : 1667817585028
console.log("5 minutes after : ", new Date().setMinutes(cDate.getMinutes() + 5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment