Razi_1 0 Newbie Poster

So I pretty much found how to make a "Shutdown Timer" from youtube.
Can anyone tell me how I can expand it to days instead of hours?

Program shutdowntimer;

uses crt,windows,dos;

const
     sec = 1000; // one second in ms
     min = 60000; // one minute in ms

var
     h,m,s:integer;
     key:char;

begin
repeat
clrscr;
writeln;
writeln (' Shutdown Timer');
writeln;
writeln (' minutes = m');
writeln (' hours = h');
writeln;
writeln (' This works only if you are an administrator of the computer');
writeln (' DO NOT USE THIS PROGRAM WITHOUT PERMISSION');
writeln;
write ('Press a key: ');
keypressed;
key:=readkey;
until (key=#109) or (key=#104);

      if (key=#109) then begin

      clrscr;
      writeln;
      write (' Please input the minutes (If you input 1, the timer starts at 2): ');
      readln (m);
      s:=60;
      repeat
      s:=s-1;
             if s=0 then begin
             m:=m-1;
             end;
      clrscr;
      writeln;
      writeln (' Time to shutdown: ',m,':',s);
      delay (sec);
      until (m=0) and (s=0);
      Exec ('C:\WINDOWS\system32\shutdown.exe', '-s -t 1'); // when time reaches 0
      end;

      if key=#104 then begin
      clrscr;
      writeln;
      write (' Please input the hours(If you input 1, the timer starts at 2): ');
      readln (h);
      m:=60;
      repeat
      m:=m-1;
             if m=0 then begin
             h:=h-1;
             end;
      clrscr;
      writeln;
      writeln (' Time to shutdown: ',h,':',m);
      delay (min);
      until (h=0) and (m=0);
      Exec('C:\WINDOWS\system32\shutdown.exe', '-s -t 1');
      end;


end.
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.