geting the time from a remote computer

kpop snag at jool.po
Thu May 8 17:59:38 EDT 2003


I have a problem with my system clock every time I start up the computer the
wrong time is set. When i change it,It runs fine until the next time I boot
up. I think the problem might be a low batery, and I intend to get a new
one. In the meantime however I want to write a script in python that will
automaticly reset my clock to the right time.

To do this i could connect to a computer on the internet, thats in the same
time zone as me, get its time and then change my own to match it. It
shouldnt be hard to change my clock time in python, theres proably a
function in one of the win32all modules or somewhere to do this on windows,
ot maybe a  dos command from os.system. Thats not the probem.

The problem is how do i get the time froma a computer on the internet.
Perhaps theres a way in one of the modules for ftp, or one of the other
internet related ones .
Can anyone tell me a way to do this .

Thanks very much











More information about the Python-list mailing list