time functions such as hourFormat12()

setTime(pctime);   // Sync Arduino clock to the time received on the serial port

The rest of that is overhead for reading the input from serial. Program your buttons to get hours, minutes, seconds (if you want), convert to a Unix time and pass as a parameter to the setTime() function. If you need the date set you'll have to include that in your Unix time parameter.