"The user enters: hhmmss "
like this I assume : 074023
which is = 7:40:23
1) check if the 1st and 2nd number is <= 24
2) check if 3rd and 4th number is <= 60
3) check if 5th and 6th number is <= 60
if all return true, then output what you need.