time from json

pull/145/head
alanbjohnston 4 years ago committed by GitHub
parent c1f0fa7260
commit d51f014fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,7 @@
import tago
import requests
import json
from datetime import datetime
while (True):
@ -13,7 +14,8 @@ while (True):
lat = telem_json['entries'][0]['lat']
lon = telem_json['entries'][0]['lng']
telem_string = telem_json['entries'][0]['comment']
time = int(telem_json['timestamp'])
print(lat)
print(lon)
print(telem_string)
@ -29,8 +31,8 @@ while (True):
altitude = 0
humidity = 0
time = chunks[0] + " " + chunks[1]
timestamp = datetime.utcfromtimestamp(time).strftime('%Y-%m-%d %H:%M:%S')
timestamp = datetime.fromtimestamp(time).strftime('%Y-%m-%d %H:%M:%S')
print(timestamp)
for i in range(len(chunks)):

Loading…
Cancel
Save

Powered by TurnKey Linux.