def get_time()

in Functions.Templates/Templates-v2/OpenAI-Assistant-Python/function_body.py [0:0]


def get_time(timeZone: str) -> str:
    logging.info(f"Getting time for {timeZone}")
    
    # Get the timezone object for the passed
    location_timezone = ZoneInfo(timeZone)

    # Get the current time for the passed in timezone
    current_time = datetime.now(location_timezone)

    return json.dumps(current_time.strftime("%H:%M:%S %p"))