Function to obtain the value of seconds of the specified minute from the date/time value.
function SecondOf(dt: double): integer;
Parameter |
Type |
Value |
---|---|---|
dt |
double |
date/time value from which you need to obtain the numeric value of seconds of the current minute. |
Returns the second of the minute, value from 0 through 59.
var
iSecond: integer;
s: string;
dtNow: double;
begin
dtNow := Now;
iSecond := SecondOf(dtNow);
s := inttostr(iSecond) + ' second';
if iSecond > 1 then s := s + 's';
s := s + ' elapsed from ' + FormatDateTime('hh:nn', dtNow) + ':00';
mLogScript(s, '');
end.
[14:55:11] (Log "SecondOf"): 11 seconds elapsed from 14:55:00