From 2cd9beba551d186651c2fd5a994ead197862cdd4 Mon Sep 17 00:00:00 2001 From: defane Date: Fri, 17 Apr 2015 13:49:38 +0200 Subject: [PATCH] Replaced strftime() by isoformat(). --- pylevel2/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylevel2/api.py b/pylevel2/api.py index 462ba2f..3c415d7 100644 --- a/pylevel2/api.py +++ b/pylevel2/api.py @@ -11,9 +11,9 @@ import json class DatetimeEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, datetime): - return obj.strftime('%Y-%m-%d %H:%M:%S') + return obj.isoformat(' ') elif isinstance(obj, date): - return obj.strftime('%Y-%m-%d') + return obj.isoformat() # Let the base class default method raise the TypeError return json.JSONEncoder.default(self, obj)