yearnumber - extract month number from a date dataset

Syntax: float yearnumber(date d)
Description: Extract the year number of each element of d
Examples: d yearnumber(d)
13-MAR-1970
14-APR-2000
1970
2000
Sample code:
#This list of dates is missing the year

A1 = "13/9" // "2/10" // "1/1" // "5/5" //
     "12/8" // "25/12" // "4/2";       
mydates = dateformat1(A1+"/98");
dd = daysince(mydates);
offset = accum(diff(dd)<0);
d = daynumber(mydates);
m = monthnumber(mydates);
y = yearnumber(mydates)+offset;
mydates = todate(y,m,d);     
See also: todate, daynumber, monthnumber

yearrange - return range of dates

Syntax: date yearrange(string dates, float dstep)
Description: Return all the January 1sts that can be found within the extremes of dates starting with the first one and then with a step of dstep
Example: dates yearrange(dates,1)
29/6/1970
25/12/1972
01-JAN-1971
01-JAN-1972
See also:

midyearrange, dayrange, monthrange

 

 

 

 

 

 

.