Skip to content
Advertisement

$date + 1 year?

I’m trying to get a date that is one year from the date I specify.

My code looks like this:

JavaScript

It’s returning the wrong date. Any ideas why?

Advertisement

Answer

To add one year to todays date use the following:

JavaScript

For the other examples you must initialize $StartingDate with a timestamp value for example:

JavaScript

Try this

JavaScript

or

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement