0

For the validation of a form i need to calculate the current date + 3 months and compare it to the value THE client inputted in the form.

Hoe to retrieve the current date plus 3 months in epoch.

I know i retrieve the current date by : (new Date).getTime()

Thanks!

  • 1
    Possible duplicate http://stackoverflow.com/questions/2706125/javascript-function-to-add-x-months-to-a-date – Jonathan Newton Feb 01 '17 at 14:32
  • 1
    Possible duplicate of [Javascript function to add X months to a date](http://stackoverflow.com/questions/2706125/javascript-function-to-add-x-months-to-a-date) – Tholle Feb 01 '17 at 14:32

1 Answers1

1

I Found the solution:

(new Date).setMonth((new Date).getMonth()+3 

this wil generate the epoch month with three months from the current date!