ScriptCore3.EncodeTime
function EncodeTime(Hour, Min, Sec, MSec: Word): TDateTime; Hour: Hours to be encoded Min: Minutes to be encoded Sec: Seconds to be encoded MSec: Miliseconds to be encoded Result: TDateTime depending on provided arguments
Description
This function allows to convert given Hour, Min, Sec and MSec into a TDateTime format.
Note that arguments are not decimal numbers, if you want to use decimals as arguments, use TryEncodeTime.
Example
var
h,m,s: Word;
currtime: TDateTime;
begin
// it's 10:57:24 at the moment.
h := 10;
m := 57;
s := 24;
currtime := EncodeTime(h,m,s,0);
WriteLn(FormatFloat('0.#########',currtime));
// 0.456527778
end.