you can try sth like:
if your_time is the variable you have for time
gen str8 stime = your_time
gen shours = substr(stime, 1, 2) *takes the first two digits
gen hours = real(shour) *reads first two digits as number
gen sminutes = substr(stime, 4, 2) *takes digits 4 and 5
gen minutes = real(sminutes)
gen sseconds = substr(stime, 7, 2)
gen seconds = real(sseconds)
*now add up
gen totsecs = 3600*hours + 60*minutes + seconds
Radu's approach assumes that the original time string will always have
2-digit hours, which will often be too restrictive, and won't work for
Christa's example.