#rails c or require require "active_support/duration" duration_text = "00:01:00" Time.parse(duration_text) - Time.parse("00:00:00") # => 60.0
Time.at(60).utc.strftime("%H:%M:%S") # => "00:01:00"
Recommended Posts