LCD Countdown timer with 2 digits each

Dear,

I'm having a litle problem figuring out how to get my countdown time that i'm using to display 2 digits for ever hour , minute and second .
For example :
Timer : 1:30:9 -> Meaning 1 hour , 30 minutes and 9 seconds
and i whould like to get it displayed as :
Timer : 01:30:09
Does some one have the solution for this ?
He would be my here ^^ .

Here is the main code i'm using :

void countdown(){ 
  
  static unsigned long lastTick = 0; // set up a local variable to hold the last time we decremented one second

// decrement one second every 1000 milliseconds
  if (second > 0) {
      if (millis() - lastTick >= 1000) {
          lastTick = millis();
          second--;
      }

  }

 // decrement one minute every 60 seconds
  if (minute > 0) { 
      if (second <= 0) {
          minute--;
          second = 60; // reset seconds to 60
      }
  }

// decrement one hour every 60 minutes
  if (hour > 0) {
      if (minute <= 0) {
          hour--;
          minute = 60; // reset minutes to 60
      }//closes if
  }//closes if
  
  moveCursor("02", "01");

  Serial.print("Time: ");
  Serial.print(hour, DEC); // the hour, sent to the screen in decimal format
  Serial.print(":"); // a colon between the hour and the minute
  Serial.print(minute, DEC); // the minute, sent to the screen in decimal format
  Serial.print(":"); // a colon between the minute and the second
  Serial.print(second, DEC); // the second, sent to the screen in decimal format
  Serial.print("    "); 
} //close countdown();

Hope some one can help me !
Thanks in advance

Jochem

Two options:

Use sprintf() to format it:

char buffer[9];
sprintf(buffer, "02%d:02%d:02%d", hours, minutes, seconds);
Serial.println(buffer); // prints in the format HH:MM:SS

Or do some simple pre-printing:

if (hours < 10)
  Serial.print('0');
Serial.print(hours)

you're my hero mate ... feeling abit ashamed that i didn't think of that ... Solved it with the givin below .

Thanks very much !

  if (hour < 10){Serial.print('0');}
  Serial.print(hour, DEC); // the hour, sent to the screen in decimal format
  Serial.print(":"); // a colon between the hour and the minute
  if (minute < 10){Serial.print('0');}
  Serial.print(minute, DEC); // the minute, sent to the screen in decimal format
  Serial.print(":"); // a colon between the minute and the second
  if (second < 10){Serial.print('0');}
  Serial.print(second, DEC); // the second, sent to the screen in decimal format
  Serial.print("    ");