diff options
Diffstat (limited to '')
| -rwxr-xr-x | scripts/bin/clocks | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/bin/clocks b/scripts/bin/clocks new file mode 100755 index 0000000..ee10ac1 --- /dev/null +++ b/scripts/bin/clocks @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +format="%H:%M" +current_time=$(date +"$format") +time="${1:-$current_time}" + +C_RESET=`tput sgr0` +C_GRAY="$(tput setaf 7)$(tput dim)"; +C_HIGHLIGHT="$(tput setaf 7)$(tput bold)" + +label() { printf "$C_GRAY$1: $C_HIGHLIGHT"; } +space() { echo -e "$C_RESET"; } + +space + +label "IST -> CET" +TZ=CET date --date="$time IST" +"$format CET" + +space + +label "CET -> IST" +date --date="$time CET" +"$format IST" + +space |
