cfg/bin/seconds2chapter
Knut Ahlers 47e20c502c
Add seconds2chapter script
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2024-08-28 01:42:34 +02:00

17 lines
253 B
Bash
Executable file

#!/usr/bin/env bash
source ~/bin/script_framework.sh
ts=${1:-}
[[ -n $ts ]] || fatal "Usage: ${0##*/} <timestamp, i.e. 12226>"
pts=()
for div in 3600 60 1; do
pt=$(( ts / div ))
ts=$(( ts % div ))
pts+=(${pt})
done
IFS=':'; echo "${pts[*]}"