diff --git a/bin/seconds2chapter b/bin/seconds2chapter new file mode 100755 index 0000000..074a901 --- /dev/null +++ b/bin/seconds2chapter @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +source ~/bin/script_framework.sh + +ts=${1:-} +[[ -n $ts ]] || fatal "Usage: ${0##*/} " + +pts=() + +for div in 3600 60 1; do + pt=$(( ts / div )) + ts=$(( ts % div )) + + pts+=(${pt}) +done + +IFS=':'; echo "${pts[*]}"