Function to obtain the value of the year from the date/time value.

 

Syntax

function YearOf(dt: double): integer;

 

Parameters and return values

Parameter

Type

Value

dt

double

date/time value from which you need to obtain a numeric value of the year.

 

Function result

Returns the year, value from 1 through 9999.

 

Example

begin
  mLogScript('Current year is: ' + inttostr(YearOf(Now)), '');
end.

Script work result

[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.

 

See also

IntToStr
mLogScript

Now