Table of Content
HAL Forum
function Time AddMinutes (
Time time,Longint number)
Description:
Increases or decreases the minute part of a given time
Parameters:
time the time to convert
number numbers of minutes to add or subtract
procedure CheckTimeMinSec(var Time timep)
begin
  if (GetSecond(timep)>=60) then begin
    timep = AddMinutes(timep,1);                     // Adds one minute to the time "timep"
    timep = AddSeconds(timep,-GetSecond(timep));     // Subtracts all the seconds from the time "timep"
  end;
  if (GetMinute(timep)>=60) then begin
    timep = AddHours(timep,1);                       // Adds one hour to the time "timep"
    timep = AddMinutes(timep,-GetMinute(timep));     // Subtracts all the minutes from the time "timep"
  end;
  return;
end;

// You can now also use timep.minute = timep.minute + 1 if you like
Related topics:
««