1#!/bin/sh 2# 3# Copyright (C) 2017 and later: Unicode, Inc. and others. 4# License & terms of use: http://www.unicode.org/copyright.html 5# 6#***************************************************************************** 7# 8# Copyright (C) 2006-2008, International Business Machines 9# Corporation and others. All Rights Reserved. 10# 11#***************************************************************************** 12timezones=`locate zoneinfo | fgrep -v evolution-data-server` 13for tzone in $timezones 14do 15 if [ -f $tzone ]; then 16 tzname=${tzone#/usr/share/zoneinfo/} 17 ICUTime=`LD_LIBRARY_PATH=../dev-icu/icu/source/lib/ TZ=$tzname ./checkTimezone` 18 systemHour=`TZ=$tzname date +%I` 19 # OS X does not allow %-I so this ugly mess needs to occur 20 if [ "${systemHour:0:1}" == "0" ]; then 21 systemHour=${systemHour:1:1} 22 fi 23 systemTimeShort=`TZ=$tzname date +%b\ %d,\ %Y` 24 systemTimeShort="${systemTimeShort} ${systemHour}" 25 systemTimeAMPM=`TZ=$tzname date +%p` 26 index1=`expr "$systemTimeShort" : '.*'` 27 index2=`expr "$ICUTime" : '.*'`-2 28 ICUTimeShort=${ICUTime:0:${index1}} 29 ICUAMPM=${ICUTime:${index2}:2} 30 systemTime=`TZ=$tzname date +%b\ %d,\ %Y\ %r` 31 if [ "$systemTimeShort" == "$ICUTimeShort" ] && [ "$systemTimeAMPM" == "$ICUAMPM" ]; then 32 if [ "$opt1" != "-bad" ]; then 33 echo TZ=$tzname 34 echo System: $systemTime 35 echo ICU: $ICUTime 36 fi 37 else 38 if [ "$opt1" == "-all" ]; then 39 echo --TZ=$tzname 40 echo --System: $systemTime 41 echo --ICU: $ICUTime 42 else 43 echo TZ=$tzname 44 echo System: $systemTime 45 echo ICU: $ICUTime 46 fi 47 fi 48 fi 49done 50