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

 

Syntax

function EndOfTheYear(dt: double): double;

 

Parameters and return values

Parameter

Type

Value

dt

double

source date/time value.

 

Function result

Date/time value that represents the last second of the last day of the selected year.

 

Example


var
  dt, dtNow: double;
begin
  dtNow := Now;
  dt := EndOfTheYear(dtNow);
  mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss', dtNow), 'Now');
  mLogScript(FormatDateTime('mm.dd.yyyy hh:nn:ss', dt), 'EndOfTheYear');
end.


Script work result

[18:08:18] (Log "EndOfTheYear"): [Now] 12.13.2016 18:08:18

[18:08:18] (Log "EndOfTheYear"): [EndOfTtheYear] 12.31.2016 23:59:59

[18:08:18] (Run "EndOfTheYear"): Script operation time: 9 ms

[18:08:18] (Run "EndOfTheYear"): Script done successfully.

 

See also

FormatDateTime
mLogScript

Now