12e5b6d6dSopenharmony_ci#!/bin/sh 22e5b6d6dSopenharmony_ci# 32e5b6d6dSopenharmony_ci# Copyright (C) 2017 and later: Unicode, Inc. and others. 42e5b6d6dSopenharmony_ci# License & terms of use: http://www.unicode.org/copyright.html 52e5b6d6dSopenharmony_ci# 62e5b6d6dSopenharmony_ci#***************************************************************************** 72e5b6d6dSopenharmony_ci# 82e5b6d6dSopenharmony_ci# Copyright (C) 2006-2008, International Business Machines 92e5b6d6dSopenharmony_ci# Corporation and others. All Rights Reserved. 102e5b6d6dSopenharmony_ci# 112e5b6d6dSopenharmony_ci#***************************************************************************** 122e5b6d6dSopenharmony_citimezones=`locate zoneinfo | fgrep -v evolution-data-server` 132e5b6d6dSopenharmony_cifor tzone in $timezones 142e5b6d6dSopenharmony_cido 152e5b6d6dSopenharmony_ci if [ -f $tzone ]; then 162e5b6d6dSopenharmony_ci tzname=${tzone#/usr/share/zoneinfo/} 172e5b6d6dSopenharmony_ci ICUTime=`LD_LIBRARY_PATH=../dev-icu/icu/source/lib/ TZ=$tzname ./checkTimezone` 182e5b6d6dSopenharmony_ci systemHour=`TZ=$tzname date +%I` 192e5b6d6dSopenharmony_ci # OS X does not allow %-I so this ugly mess needs to occur 202e5b6d6dSopenharmony_ci if [ "${systemHour:0:1}" == "0" ]; then 212e5b6d6dSopenharmony_ci systemHour=${systemHour:1:1} 222e5b6d6dSopenharmony_ci fi 232e5b6d6dSopenharmony_ci systemTimeShort=`TZ=$tzname date +%b\ %d,\ %Y` 242e5b6d6dSopenharmony_ci systemTimeShort="${systemTimeShort} ${systemHour}" 252e5b6d6dSopenharmony_ci systemTimeAMPM=`TZ=$tzname date +%p` 262e5b6d6dSopenharmony_ci index1=`expr "$systemTimeShort" : '.*'` 272e5b6d6dSopenharmony_ci index2=`expr "$ICUTime" : '.*'`-2 282e5b6d6dSopenharmony_ci ICUTimeShort=${ICUTime:0:${index1}} 292e5b6d6dSopenharmony_ci ICUAMPM=${ICUTime:${index2}:2} 302e5b6d6dSopenharmony_ci systemTime=`TZ=$tzname date +%b\ %d,\ %Y\ %r` 312e5b6d6dSopenharmony_ci if [ "$systemTimeShort" == "$ICUTimeShort" ] && [ "$systemTimeAMPM" == "$ICUAMPM" ]; then 322e5b6d6dSopenharmony_ci if [ "$opt1" != "-bad" ]; then 332e5b6d6dSopenharmony_ci echo TZ=$tzname 342e5b6d6dSopenharmony_ci echo System: $systemTime 352e5b6d6dSopenharmony_ci echo ICU: $ICUTime 362e5b6d6dSopenharmony_ci fi 372e5b6d6dSopenharmony_ci else 382e5b6d6dSopenharmony_ci if [ "$opt1" == "-all" ]; then 392e5b6d6dSopenharmony_ci echo --TZ=$tzname 402e5b6d6dSopenharmony_ci echo --System: $systemTime 412e5b6d6dSopenharmony_ci echo --ICU: $ICUTime 422e5b6d6dSopenharmony_ci else 432e5b6d6dSopenharmony_ci echo TZ=$tzname 442e5b6d6dSopenharmony_ci echo System: $systemTime 452e5b6d6dSopenharmony_ci echo ICU: $ICUTime 462e5b6d6dSopenharmony_ci fi 472e5b6d6dSopenharmony_ci fi 482e5b6d6dSopenharmony_ci fi 492e5b6d6dSopenharmony_cidone 50