Add a Year to Today's Date

Add A Year To Today's Date

You can create a new date object with todays date using the following code:

var d = new Date();    console.log(d);

Add a year to current date

from datetime import *
from dateutil.relativedelta import relativedelta

date = date.today()
newDate = date + relativedelta(years=1)

Adding 1 Year to a Date with JavaScript

var date = new Date("2014-10-29"); 
date.setFullYear(date.getFullYear() + 1);

PHP date add 5 year to current date

Try with:

$end = date('Y-m-d', strtotime('+5 years'));

How to add one year to current year using DateTime

Add years to the DateTime, not the year

DateTime.Now.AddYears(1);

Javascript: add year to the current timestamp

You need to use a Date constructor to create the date from the value you calculated.

new Date(Date.now() + 315569520 * 1000)

You need to add the value of 10 years in milliseconds, and then pass the new value to a Date constructor



Related Topics



Leave a reply



Submit