setDate date function
The output of this will be
What happens when we add more that 30 or 31st day to the date function. This will take us to future date starting from 1st day of the current month.
Next month 5th or 4th date will be displayed like this.
Now let us add 365 to this function. We will get next year this month. Here is the code.
The output is here
What happens when we use –negative number with setDate function.
It will display 20 days backword from 1st of the present month.
Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
|
▼ More on JavaScript Date |