User Tools

Site Tools


syntax:functions:age

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
syntax:functions:age [2015/02/01 13:51] – created dmitrysyntax:functions:age [2021/08/29 22:34] craigt
Line 1: Line 1:
-===== Age(date_as_number,date_as_number) =====+====== Age(date1date2) =====
 +Category:  Date and Time function 
 + 
 +\\  
 +=====Description===== 
 +This function returns the number of full years between two dates (//date1// and //date2//). 
 + 
 +\\  
 +=====Arguments===== 
 +^Argument^Type^Description^ 
 +|date1|Date or Number (date serial)|An expression representing a date.| 
 +|date2|Date or Number (date serial)|An expression representing a date.| 
 + 
 +**Return value type:** Number (Integer). 
 + 
 +\\  
 +=====Remarks===== 
 +The result is a non-fractional number (integer), as an absolute value, so the dates can be entered in either order. 
 + 
 +The //date1// and //date2// arguments can take any value or expression that evaluates to a date serial value.  Examples include:   
 +  * A date string:  #2019-12-12 
 +  * A date serial value: 43811 (the date serial for "2019-12-12"
 +  * A date value created using the [[syntax:functions:date|Date]] function: date("2019-12-12","yyyy-MM-dd"). 
 + 
 + 
 +\\  
 +=====Examples===== 
 + 
 +  age(#1960-05-10, #2021-08-29)  //Returns 61. 
 + 
 +  age(#2021-08-29, #1960-05-10)  //Returns 61.  (Dates are in reversed order from above.) 
 + 
 +  age(#1825-06-15, #2050-06-15)  //Returns 225. 
 + 
 +\\  
 +=====See also===== 
 +  * [[syntax:functions:agemonths|AgeMonths(date1,date2)]]
  
-Number of years between to dates. Result is an integer number. 
syntax/functions/age.txt · Last modified: 2021/08/30 01:55 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki