summary refs log tree commit diff
path: root/worldclock
blob: 4ee027a0d07c4408f9007ab0b40a81492f6d820e (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
28
29
#!/bin/bash

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

HOMEZONE=America/Los_Angeles

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 ; continue
	else break
	fi
    sleep 1
done