Advertisement
rfmonk

print_machine_time.py

May 24th, 2014
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. import ntplib
  5. from time import ctime
  6.  
  7. def print_time():
  8.     ntp_client = ntplib.NTPClient()
  9.     response = ntp_client.request('pool.ntp.org')
  10.     print ctime(response.tx_time)
  11.  
  12. if __name__ == '__main__':
  13.     print_time()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement