linux - Simple way to convert HH:MM:SS (hours:minutes:seconds.split seconds) to seconds -


What is an easy way to change

00: 20: 40.28 (hh: mm: ss) Is sec with a bash script?

Split seconds can be cut, it is not necessary.

Try awk . As a bonus, you can keep split seconds.

  echo "00: 20: 40.25" | Awk -F: '{Print ($ 1 * 3600) + ($ 2 * 60) + $ 3}' ' 

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -