summaryrefslogtreecommitdiff
path: root/kpov_judge
diff options
context:
space:
mode:
authorlz4830@student.uni-lj.si <lz4830@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2014-12-12 16:42:42 +0000
committerlz4830@student.uni-lj.si <lz4830@student.uni-lj.si@5cf9fbd1-b2bc-434c-b4b7-e852f4f63414>2014-12-12 16:42:42 +0000
commit8fb1396f4cf3f94fa0ef223e51b43129e0561b3e (patch)
tree8de11e6392cbb6b55293c92ac4e4ffcc789857e2 /kpov_judge
parenta2f791bde9aef13909bbf74b5d4acf8f12b1fd78 (diff)
poizkus rdate serverja, socket pridobitev datuma razpakiranje offset nazaj na socket brez editorja
git-svn-id: https://svn.lusy.fri.uni-lj.si/kpov-public-svn/kpov-public@50 5cf9fbd1-b2bc-434c-b4b7-e852f4f63414
Diffstat (limited to 'kpov_judge')
-rw-r--r--kpov_judge/tasks/custom_rdate/rDate.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/kpov_judge/tasks/custom_rdate/rDate.py b/kpov_judge/tasks/custom_rdate/rDate.py
new file mode 100644
index 0000000..8ddeec4
--- /dev/null
+++ b/kpov_judge/tasks/custom_rdate/rDate.py
@@ -0,0 +1,9 @@
+s = socket.socket(
+ socket.AF_Inet, socket.SOCK_STREAm)
+s.connect(("ntp1.arnes.si,80"))
+podatek = s.recv(4)
+stevilka = struct.unpack(">I", podatek)
+stevilka+=stevilka+50000
+stevilka+=22808988800L
+date = time.localtime(stevilka)
+s.send(date)