Search

Subtract Years From Date

Articles

Use this function to subtract the number of years from the given date.

Syntax

Subtract Years From Date (no_of_years, input_date, date_format)

Parameters

Input Parameter Name Description
no_of_years Number of years to be subtracted
input_date Date in string format
date_format Date Format of the input_date parameter
To know more about Date Format, click here.

Returns

Return value Description
Date Returns the modified date in the same format specified in date_format

Sample

Subtract Years From Date (2, 28/03/2021, %d/%m/%Y)

  • Subtracts 2 years from the date 28/03/2021 in the format %d/%m/%Y.
    Returns 2019-03-11.

To view all the Date functions, click here.

Did you find what you were looking for?