website logo
Navigate through spaces
Carrot reference
⌘K
Carrot reference
Getting started with Carrot
Premade Carrot filters
Operator precedence
Expression truthiness
Carrot fields
Basic Org Information
Compensation
Job Changes
Permissions
Personal
Recruiting
Structure
Time off
Data types
Elements of Carrot expressions
Functions
Operators
Keywords
Aggregators
Docs powered by archbee 
website logo

diffYears()

Returns the total number of years between two given dates.

Syntax

diffYears(date1, date2)

  • date1 - the date from which counting begins.
  • date2 - the date at which counting ceases.
  • Return type: Number

Sample usage

diffYears('2021-10-11', '2020-10-11') returns 1.

Supported data types

Input type

Return type

Logic

Date (x2)

Number

The function will count the number of years beginning with date1, and ending with date2.

Unsupported data types

Null

Unsupported data types return Null.

Updated 01 Feb 2023
Did this page help you?
Yes
No
UP NEXT
diffMonths()
Docs powered by archbee