1.python代码
import ntplib
from time import ctime
def print_time():
ntp_client = ntplib.NTPClient()
response = ntp_client.request('pool.ntp.org')
print ctime(response.tx_time)
if __name__ == '__main__':
print_time()
转载请标注原文地址:http://blog.csdn.net/ddjohn/article/details/49997437