Command Reference : String and Date Function Reference
  
 
@makedate
Numbers to date number.
Syntax: @makedate(arg1[, arg2[,arg3]], fmt)
arg1: number
args: (optional) number(s) arg2, arg3, ...
fmt: date format
Return: date number
Takes the numeric values given by the arguments arg1, and optionally, arg2, etc. and returns a date number using the required format string, fmt.
If more than one argument is provided, the arguments must be listed from the lowest frequency to the highest, with the first field representing either the year or the hour.
Examples
The expressions,
@makedate(1999, "yyyy")
@makedate(99, "yy")
both return the date number 729754.0 corresponding to 12 midnight on January 1, 1999.
@makedate(199003, "yyyymm")
@makedate(1990.3, "yyyy.mm")
@makedate(1031990, "ddmmyyyy")
@makedate(30190, "mmddyy")
all return the value 726526.0, representing March 1, 1990.
Dates may be created using multiple arguments. The expressions,
@makedate(97, 12, 3, "yy mm dd")
@makedate(1997, 12, 3, "yyyymmdd")
will return the value 729360.0 corresponding to midnight on December 3, 1997. You may provide a subset of this information so that
@makedate(97, 12, "yymm")
returns the value 729358.0 representing the earliest date and time in December of 1997 (12 midnight, December 1, 1997). Likewise,
@makedate(1997, 37, "yyyy ddd")
yields the value 729060.0 (February 6, 1997, the 37th day of the year) and
@makedate(14, 25, 10, "hh mi ss")
fills the series YM with date numbers for observations in the workfile sample.
If Y is a series containing year data, M is a series containing month data, and DT is a series containing day data,
series ymd = @makedate(y, m, dt, "yyyymmdd")
fills the series YMDSTR with date numbers formed using those series, for observations in the workfile sample.
Let MYDATE is a series that contains values with the year and month combined in a single number (e.g., “201011”, “200505”),
mydate = y * 100 + m
series ym = @makedate(mydate, "yyyymm")
Then YM contains the date number associated with MYDATE.
If YVEC is a vector with (hour*10000 + minute*100 + seconds) values,
vector yearvec = @makedate(yvec, "hhmiss")
fills YEARVEC with the date numbers associated with each element of YVEC.
Cross-references
See “Date Formats” and “Translating Ordinary Numbers into Date Numbers” for additional details.
See @datestr for string representations of date numbers.