#!/usr/bin/python3
import sys,argparse
import phonenumbers
from phonenumbers import timezone
from datetime import datetime  
from zoneinfo import ZoneInfo

parser = argparse.ArgumentParser()
parser.add_argument('phoneNumber', help="phone number: any format")
parser.add_argument('region',help="Region/country code: 2 uppercase letters")
args = parser.parse_args()

raw_number = str(args.phoneNumber)
local_region = str(args.region)
try:
  x = phonenumbers.parse(raw_number,local_region)
except:
  print("",flush=True,end='')
  #Phone number was not parsable
  exit()
list_of_tz = timezone.time_zones_for_number(x)
list_of_offset_tz = []
T_now = datetime.now()
time_now = T_now.strftime('%H:%M')
for tz in list_of_tz:
  try:
    TZ = ZoneInfo( tz  )
    T_TZ = T_now.astimezone(TZ)
    list_of_offset_tz.append ( [int(T_TZ.strftime('%z') ), T_TZ ] )
  except:
    pass
    # unknown time zone / unknown offset

if len(list_of_offset_tz) == 0:
      print("",flush=True,end='')
      # empty final list of  offset-time
      exit()
min = min(list_of_offset_tz)[1].strftime('%H:%M')
max = max(list_of_offset_tz)[1].strftime('%H:%M')

if max == min:
  if min == time_now:
    # offset is same as local time zone (same location ? )
    print("", flush=True,end='')
  else:
    print (min,flush=True,end='')
else:
  print ( min, "<-->" , max ,flush=True,end='')

