Clarification on "if" statement - Digital Clock Tutorial C# I am building a digital clock in C# after watching a tutorial. The code in the tutorial I need help understanding looks like this:

if (hh &lt; 10) {
    time += "0" + hh;
}
else {
    time += hh;
}
time += ":";


Can anyone explain to me why hh &lt; 10? Should it not be at least 12?

My end  game is to make a timer that starts at 9am and stops at 5pm. Ongoing applications under development. Looking at time money management.
Welcome to Codereview. As I can see you are having troubles understanding the line that adds a "0" in front of hh. Let's say hh is 9. Then, as 9 is smaller than 10, time will be "09", if hh is "10", or greater, it won't add that "0" at the beginning. After that (time += ":"), the program will add a ":" which would represent the hours in the clock and a ":" character afterwards, like "10:" or "09:". So, When it adds the minutes, the algorithm will use a similar if statement, like this:

if (hh &lt; 10) {
    time += "0" + hh;
}
else {
    time += hh;
}
time += ":";
if (mm &lt; 10) {
    time += "0" + mm;
}
else {
    time += mm;
}


at the end the time that will be shown, will look something like "09:09", and such.