Converting seconds to Hours:Minutes:Seconds and keypad input

Hello,

I am working on a project using an Arduino to make a countdown timer. At the moment I have a timer that counts down from a big number of seconds and is started with a pushbutton, I would like to convert the big number of seconds into a hour : minute : seconds format and have that numbeer be edit-able with the help of a keypad I have wired to the Arduino.

Thank you very much for the help.

Here is a pastebin of the code: ARDUINO CODE - Pastebin.com . I also pasted it below.

< // libraries toevoegen //
  #include <Wire.h>
  #include <Keypad.h>
  #include <LiquidCrystal.h>
   // de lcd en de buzzer instellen // 
  LiquidCrystal lcd(A0,A1,A2,A3,A4,A5);
 
 
  // de keypad instellen //
  const byte ROWS=4;
  const byte COLS=4;
 
  char hexaKeys[ROWS][COLS]={
    {'1','2','3','A'},
    {'4','5','6','B'},
    {'7','8','9','C'},
    {'*','0','#','D'}
  };
 
  byte rowPins[ROWS]={9,8,7,6}; 
  byte colPins[COLS]={5,4,3,2};
 
  Keypad customKeypad= Keypad(makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
  char customKey = customKeypad.getKey();
 
 // variabelen instellen //
  int timerMode=0;
  int countdown_time=10;
  int reset=0;
  int klaar=0;
  const byte buzzer=12;
  const byte startButton=13;
  const byte resetButton=12;
  unsigned long eventTime=1000;
  unsigned long previousTime=0;
 
// leuk symbolen instellen //
 
 
// setup //
  void setup() {
    lcd.begin(16,2);
    lcd.clear();
    tone(buzzer,100,100);
    tone(buzzer,200,100);
    pinMode(startButton, INPUT_PULLUP);
    pinMode(resetButton, INPUT_PULLUP);
    pinMode(buzzer, OUTPUT);
    lcd.setCursor(0,0); 
    lcd.print("** Ergo timer **");
    lcd.setCursor(0,1);
    lcd.print("****************");
 
  }
 
  void loop() {
 
    if(digitalRead(startButton)==LOW){
      timerMode++;
    }
   while(timerMode==1 and countdown_time > 0){
 
     unsigned long currentTime=millis();
     if (currentTime - previousTime >= eventTime){
      countdown_time--;
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("** TOT PAUZE: **");
      lcd.setCursor(0, 1);
      lcd.print("****** ");
      lcd.print(countdown_time);
      lcd.print(" *******");
      previousTime=currentTime;
      if (countdown_time ==0 and klaar==0){
      lcd.clear();
      tone(buzzer,200,2000);
      lcd.setCursor(0,0);
      lcd.print("*** NU PAUZE ***");
      lcd.setCursor(0,1);
      lcd.print("****************");
      klaar++;
       }
      }
     }
 
}  

It would be easier to allow input and edit of the hour, minute and seconds values and to convert that to a "big number" for the countdown, but you don't actually need a "big number"

When the countdown starts decrement the seconds every second. When the seconds reach zero decrement the minutes, when the minutes reach zero decrement the hour, when all 3 are zero the count is finished

hours = seconds / 3600
minutes = (seconds / 60) % 60
actual_seconds = seconds % 60