Skip to content

Commit

Permalink
NTP completed
Browse files Browse the repository at this point in the history
  • Loading branch information
subhayuroy committed Sep 16, 2020
1 parent d188548 commit 97819a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions Network Time Protocol (NTP)/ntp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import ntplib
import time

NIST = 'nist1-macon.macon.ga.us'
ntp = ntplib.NTPClient()
ntpResponse = ntp.request(NIST)

if (ntpResponse):
now = time.time()
diff = now-ntpResponse.tx_time
print(diff)

0 comments on commit 97819a7

Please sign in to comment.