How do I get the atomic clock time in python? -
is there way access time given particular atomic clock website using python module?
i not looking extreme accuracy. looking way make sure program gets correct time in case users cpu time incorrect.
i have searched on python 3 module index , have found time modules none mention atomic clock.
i have looked on google , found few mentions nothing current , useful.
edit: info everyone. guess have make sure users clock correct or have them make sure of it. maybe can check atomic clock when user starts program , if clock off amount, show pop lets them know of difference in time , give them option disable popup.
thanks! zach
ntplib use synchronization in python. if wanted accuracy use that. otherwise i'd make sure clock right , use
>>> datetime import datetime >>> datetime.now()
ntplib example
>>>import ntplib >>>from time import ctime >>>c = ntplib.ntpclient() >>>response = c.request('europe.pool.ntp.org', version=3) >>>ctime(response.tx_time) 'sun may 17 09:32:48 2009'
Comments
Post a Comment