Function to obtain the value of the year from the date/time value.
function YearOf(dt: double): integer;
Parameter |
Type |
Value |
---|---|---|
dt |
double |
date/time value from which you need to obtain a numeric value of the year. |
Returns the year, value from 1 through 9999.
begin
mLogScript('Current year is: ' + inttostr(YearOf(Now)), '');
end.
[21:43:06] (Log "YearOf"): Current year is: 2016
[21:43:06] (Run "YearOf"): Script operation time: 2 ms
[21:43:06] (Run "YearOf"): Script done successfully.