User Tools

Site Tools


syntax:functions:year

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
syntax:functions:year [2015/04/03 20:21] elenapsyntax:functions:year [2021/08/30 02:44] (current) craigt
Line 1: Line 1:
-===== Year(date_as_number) =====+====== Year(date) =====
 +Category:  Date and Time function
  
-Extracts the corresponding year, as a four-digit number, from the date_as_number.+\\  
 +=====Description===== 
 +This function returns the year, as a four-digit number, from //date//.
  
-^  Example   Result   Notes  ^ +\\  
-year(42097)  |  2015  |  42097 corrensponds to April 4th, 2015  | +=====Arguments===== 
-year( makedate(2014,1,1) )  |  2014     |+^Argument^Type^Description^ 
 +|date|Date or Number (date serial)|An expression representing a date.  The date value to derive the year number from.| 
 + 
 +**Return value type:** Number  
 + 
 +\\  
 +=====Remarks===== 
 +The //date// argument 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 any of the Date/Time functions that returns a date serial value. 
 + 
 +\\  
 +=====Examples===== 
 + 
 +  year(42097)  //Returns 2015 (42097 corresponds to April 4th, 2015.) 
 + 
 +  year( #2014-01-01 //Returns 2014 
 + 
 +\\  
 +=====See also===== 
 +  * [[syntax:functions:day|Day(date)]] 
 +  * [[syntax:functions:month|Month(date)]] 
 +  * [[syntax:functions:weekday|Weekday(date)]] 
 +  * [[syntax:functions:makedate|MakeDate(year, month, day)]]
  
-=== See also === 
-  * [[syntax:functions:day]] 
-  * [[syntax:functions:month]] 
-  * [[syntax:functions:makedate]] 
syntax/functions/year.1428106905.txt.gz · Last modified: 2015/04/03 20:21 by elenap

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki