client ntp en python

J'ai écrit un client ntp en python pour interroger un serveur de temps et d'afficher l'heure et le programme s'exécute mais ne me donne pas tous les résultats.
Je suis à l'aide de python 2.7.3 environnement de développement intégré et mon OS est Windows 7.
Voici le code:

# File: Ntpclient.py
from socket import AF_INET, SOCK_DGRAM
import sys
import socket
import struct, time

# # Set the socket parameters 

host = "pool.ntp.org"
port = 123
buf = 1024
address = (host,port)
msg = 'time'


# reference time (in seconds since 1900-01-01 00:00:00)
TIME1970 = 2208988800L # 1970-01-01 00:00:00

# connect to server
client = socket.socket( AF_INET, SOCK_DGRAM)
client.sendto(msg, address)
msg, address = client.recvfrom( buf )

t = struct.unpack( "!12I", data )[10]
t -= TIME1970
print "\tTime=%s" % time.ctime(t)

source d'informationauteur Howard Hugh