Search

Add Years

Last Updated: Nov 4, 2020

Articles

Use this function to add the number of years for the given date.

Syntax

Add Years (no_of_years, input_date, date_format)

Parameters

Input Parameter Name Description
no_of_years Number of years to be added
input_date given date in string format
date_format Date Format of the input_date parameter
For more information, refer to the below table Date Format.

Sample

  1. Add Years (20, 12/10/2000, %d/%m/%Y) = 12/10/2020
  2. Add Years (03, 2017/10/12, %Y/%m/%d) = 2020/10/12

Date Format

Code Meaning Example
%d Day of the month as a zero-padded decimal number 30
%-d Day of the month as a decimal number (Platform specific) 30
%m Month as a zero-padded decimal number 09
%B Month as locale’s full name September
%b Month as locale’s abbreviated name Sep
%y Year without century as a zero-padded decimal number 20
%Y Year with century as a decimal number 2020

To view all the Date functions, click here.

Did you find what you were looking for?