function AddMinute(val: TTime; num: Integer): TTime;
var
nH, nM, nS, nMs: Word;
nTemp: Cardinal;
begin
DecodeTime(val, nH, nM, nS, nMs);
nTemp := nH * 3600 * 1000 + nM * 60 * 1000 + nS * 1000 + nMs;
nTemp := nTemp + num * 60 * 1000;
nMs := nTemp mod 1000;
nS := nTemp div 1000;
nM := nS div 60;
nH := nM div 60;
Result := EncodeTime(nH mod 24, nM mod 60, nS mod 60, nMs);
end;