Compare commits

...

1 Commits

Author SHA1 Message Date
9a092c6b01 Changed req_date to ISO8601 format (naively UTC) 2019-08-11 21:29:27 -04:00

View File

@ -19,7 +19,7 @@ def getships():
This is to be used in concert with the rest of ACF_ShipTracker python script to save as a CSV and email once a day. This is to be used in concert with the rest of ACF_ShipTracker python script to save as a CSV and email once a day.
""" """
matrix = [] matrix = []
req_time=datetime.today().strftime("%m/%d/%Y, %H:%M:%S") req_time=datetime.utcnow().strftime("%FT%H:%M:%S")
redata = json.loads(requests.get( redata = json.loads(requests.get(
'https://services.marinetraffic.com/api/exportvessels/v:8/ea1f4a05afbd000ba30772a9979bf7aa743092cb/timespan:60/msgtype:extended/protocol:json').content) 'https://services.marinetraffic.com/api/exportvessels/v:8/ea1f4a05afbd000ba30772a9979bf7aa743092cb/timespan:60/msgtype:extended/protocol:json').content)
for ship in range(len(redata)) : for ship in range(len(redata)) :
@ -57,6 +57,7 @@ rowheadings=[
'Est Wave Height 2000m', 'Est Wave Height 3000m' 'Est Wave Height 2000m', 'Est Wave Height 3000m'
] ]
# The following is not UTC, since /etc/localtime is America/New_York
x2 = datetime.now() x2 = datetime.now()
matrix = getships() matrix = getships()
csv_name = "/var/log/acfst/ACFshipdata_{}-{}-{}.csv".format(x2.year, '{:02d}'.format(x2.month), '{:02d}'.format(x2.day)) csv_name = "/var/log/acfst/ACFshipdata_{}-{}-{}.csv".format(x2.year, '{:02d}'.format(x2.month), '{:02d}'.format(x2.day))