Using Time.strptime
will do what you want (I think):
> require 'time' # not needed inside rails
> time = Time.strptime("06:04:55", "%H:%M:%S")
> time.sec
55
> time.min
4
> time.hour
6
> require 'active_support/core_ext' # not needed in rails
> time.seconds_since_midnight.to_i
21895