yeartodate - script and chart function
This function finds if the input timestamp falls within the year of the date the script was last loaded, and returns
Syntax:
YearToDate(timestamp[ , yearoffset [ , firstmonth [ , todaydate] ] ])
Return data type: Boolean
If none of the optional parameters are used, the year to date means any date within one calendar year from January 1 up to and including the date of the last script execution.
Arguments:
Argument | Description |
---|---|
|
The timestamp to evaluate, for example '2012-10-12'. |
|
By specifying a yearoffset, yeartodate returns |
|
By specifying a firstmonth between 1 and 12 (1 if omitted) the beginning of the year may be moved forward to the first day of any month. For example, if you want to work with a fiscal year beginning on May 1, specify firstmonth = 5. |
|
By specifying a todaydate (timestamp of the last script execution if omitted) it is possible to move the day used as the upper boundary of the period. |