Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

To add one month to current date

I have to add one month to todays date and have to get date after 1 month.Can anybody help?

like image 382
user42348 Avatar asked Sep 05 '09 08:09

user42348


People also ask

How do you add one day to a date now?

Firstly, the Date() constructor is called with a new keyword. In this constructor, the now() method is employed with “3600 * 1000 * 24”(number of milliseconds in one day) to add one day to the current date. The now() method returns the milliseconds. Lastly, the updated date is printed on the console.


2 Answers

Dim newDate as DateTime = DateTime.Now.AddMonths(1)
like image 78
Philip Fourie Avatar answered Nov 16 '22 01:11

Philip Fourie


dateAfterMonth = dateAfterMonth.AddMonths(1)
If you would add 1 month from now:
dateAfterMonth = DateTime.Now.AddMonths(1)

like image 40
Marcin Deptuła Avatar answered Nov 16 '22 02:11

Marcin Deptuła