If you wish you can read these similar tutorials:
If you want to learn formatting date you can read these,
Those above tutorials are closely related to this one. Almost the same process and the same type of method is used.
Here I have to use two methods:
Now let’s code it:
Thu Jan 10 2019 12:23:15 GMT+0530 (India Standard Time)
In the above example, we added 2 months to the current date object.
var mydate = new Date();
Firstly, This stores the current date in the mydate variable.
Then, Here we have added two months to mydate.
Special note: If you wish you can use your custom date. In order to do that just add your own date in the Date() as a parameter.
If you want to use system date just don’t pass any parameter to it.
Finally, I hope this tutorial was helpful to you. Feel free to comment below if any doubt arises.
Leave a Reply