|FUNCTION|| The function returns the number of days that passed since January 1st, 1900, counting from 2. January 1, 1900 is serial number 2, and January 1, 2008 is serial number 39448.
Technically is equal to Windows OLEDATE and Excel's DATEVALUE function. As to why it starts counting from 2 (two) - it is to get the same values as Excel DATEVALUE. Excel's DATEVALUE function starts counting from one but it includes Feb 29, 1900 which did not exist and this adds extra one day for all dates starting from Mar 1st, 1900.
The function can be used for calculations that involve calendar days as opposed to trading days and replaces previously proposed AFL solution http://www.amibroker.com/kb/2007/03/15/calendar-day-index/
Now RefDays can be implemeted as follows (see example)
|SEE ALSO||Date() function , DateNum() function , DateTime() function , DateTimeConvert() function|
The DaysSince1900 function is used in the following formulas in AFL on-line library:
See updated/extended version on-line.