#!/bin/sh -e
#
# shellcheck disable=SC2312

if [ -n "$1" ]; then
  time="$1"
else
  time=''
fi

print_date() {
  if [ -n "${time}" ]; then
    printf '%-9s %s \n' "$1:" "$(TZ=$2 date +'%a, %d %b %H:%M' --date "${time}"\ "$(date +%Z)")"
  else
    printf '%-9s %s \n' "$1:" "$(TZ=$2 date +'%a, %d %b %H:%M')"
  fi
}

print_date "Los Ang." America/Los_Angeles
print_date "New York" America/New_York
print_date "London" Europe/London
print_date "Berlin" Europe/Berlin
print_date "Bangkok" Asia/Bangkok
print_date "Tokyo" Asia/Tokyo
print_date "Sydney" Australia/Sydney
