title: Convert duration string into seconds integer
body: <p>I want to turn strings that represent durations into their duration in seconds as an integer.</p>
  <p>All of the strings are formatted in the following way:</p>
  <pre><code>hh:mm:ss
  </code></pre>
  <p>I was working with substrings, which I cast to integers and then multiplied with 3600, 60 or 1 respectively and in the end summed everything up.</p>
  <p>Just like this:</p>
  <p><code>SELECT
  cast(substr(time_string, 1, 2) as smallint) * 3600 + cast(substr(time_string, 4, 2) as smallint) * 60 + cast(substr(time_string, 7, 2) as smallint) as seconds
  from table_name
  </code></p>
  <p>As I have to do this for multiple fields, I would be interested in a better way to achieve this result. My search for a better solution, though, fell flat so far.</p>
  <p>I would appreciate any input or help!</p>