rwxrob-dot/scripts/countdown
2022-03-06 18:09:46 -05:00

9 lines
193 B
Bash
Executable File

#!/usr/bin/env bash
time="$*"
[[ -z "$time" ]] && echo "usage: $0 TIME (see date -d)" && exit 1
start=$(date "+%s" -d "$time")
now=$(date "+%s")
declare -i secs=$((now-start))
sec2dur "$secs"