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 < 10) {
time += "0" + hh;
}
else {
time += hh;
}
time += ":";
Can anyone explain to me why hh < 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.
'0'
character for any hour lower than10
for representation. Nothing to do with the 12 hour clock cycle. \$\endgroup\$