#!/usr/bin/env python3
import ntplib
import sys
from time import ctime
c = ntplib.NTPClient()
try:
    response = c.request(sys.argv[1])
    print(ctime(response.tx_time))
except ntplib.NTPException as e:
    print(f"ERROR during NTP request: {e}")
    print("Usage: ntp-client.py <hostname>")
    sys.exit(-1)
    
