Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Output the string date as datetime

  • Loading branch information...
commit e95b9749156baa0b40bdf243073534e222c3a53a 1 parent 871db86
Tim Kleinschmidt Azd325 authored
Showing with 13 additions and 2 deletions.
  1. +2 −2 cmsplugin_eviscape/__init__.py
  2. +11 −0 cmsplugin_eviscape/views.py
4 cmsplugin_eviscape/__init__.py
View
@@ -1,2 +1,2 @@
-VERSION = (0, 9, 2)
-__version__ = "0.9.2"
+VERSION = (0, 9, 3)
+__version__ = "0.9.3"
11 cmsplugin_eviscape/views.py
View
@@ -1,6 +1,10 @@
import urllib2
import json
+from datetime import datetime
+
+EVISCAPE_TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
+
def get_sent_evis(server, nod_id, limit, evis_type):
"""(Currently) returns a list of dictionaries with keys evis, ref and id.
@@ -27,4 +31,11 @@ def get_sent_evis(server, nod_id, limit, evis_type):
sent_evis = [e for e in data['objects'] if e['evis']['typ_value'] == evis_type]
else:
sent_evis = [e for e in data['objects']]
+ for e in sent_evis:
+ e['evis']['evi_insert_date'] = convert_str_to_date(e['evis']['evi_insert_date'])
return sent_evis
+
+
+def convert_str_to_date(value):
+ date = datetime.strptime(value, EVISCAPE_TIME_FORMAT)
+ return date
Please sign in to comment.
Something went wrong with that request. Please try again.