summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2013-08-14 22:11:22 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2013-08-14 22:11:22 +0200
commitb0834f7eac1e1e5bbc481d0069b47a39be3d35b0 (patch)
treea85f5187583799b6402f42286b79f0a388a87c9a /modules
parent6e40ac66d0597bbfe2b360a319693c84d4c46273 (diff)
tracking: Parse datetime for tollpost.
Diffstat (limited to 'modules')
-rw-r--r--modules/tracking.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/tracking.py b/modules/tracking.py
index 5ba09b2..1d6a5f7 100644
--- a/modules/tracking.py
+++ b/modules/tracking.py
@@ -219,11 +219,11 @@ class TollpostModule(TrackingModule):
code = item['itemId']
delivered = (item['status'] == 'DELIVERED')
lastevent = item['events'][-1]
- date = lastevent['eventTime'].replace('T', ' ')
+ date = datetime.datetime.strptime(lastevent['eventTime'], '%Y-%m-%dT%H:%M:%S')
event = lastevent['eventDescription']
location = lastevent['location']['name']
status = '%s (%s)' % (event, location)
- results.append(TrackingResult(code, date, status, delivered))
+ results.append(TrackingResult(code, date, status.encode('utf-8'), delivered))
return results
def code_split(code):