summary refs log tree commit diff
path: root/worldclock
blob: 8c01a3f085a524febbe53360ed0e1fe89cb9a167 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

ZONES="America/Los_Angeles America/New_York UTC Europe/London Europe/Paris Asia/Bangkok Pacific/Auckland Singapore unix"

HOMEZONE="$TZ"

while :
do
    clear
    echo
    for TZ in $ZONES ; do
        if [ $TZ = "unix" ]
        then TIME=$( date +%s )
        else TIME=$( date )
        fi
        echo -e $TIME "\t" $TZ
    done
    echo
    echo
    if [ -n $"$HOMEZONE" ] ; then
        TZ=$HOMEZONE date +%T | sed -e 's/:/ . /g' | figlet -f banner
    fi
    if [ x"$1" = x"loop" ]
    then sleep 1
    else break
    fi
done