You can get the date 5 months from now by creating a new Date object and adding 5 months to the current date. Here's an example:
index.tsx107 chars3 lines
In this example, we first create a new Date object and store it in the currentDate
variable. We then add 5 months to the current date using the setMonth()
method and store the result in the futureDate
variable.
You can also get the timestamp (in milliseconds since January 1, 1970) for the future date using the getTime()
method:
index.tsx44 chars2 lines
gistlibby LogSnag