aboutsummaryrefslogtreecommitdiff
path: root/modules/user_time.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-04 10:29:05 +0100
committerGravatar jesopo2019-09-04 10:29:05 +0100
commitc4428e479f47fc3a6df09eb3c340c196b47243ae (patch)
tree524afe27a60d81dd1b0b718612faf0bcb74404fc /modules/user_time.py
parentcorrectly qualify DeadlineExceededException namespace (diff)
signature
Force removal of ":" from user_time.py API-provided ISO8601
Diffstat (limited to 'modules/user_time.py')
-rw-r--r--modules/user_time.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/user_time.py b/modules/user_time.py
index 47ba1708..8fe3faa2 100644
--- a/modules/user_time.py
+++ b/modules/user_time.py
@@ -29,6 +29,12 @@ class Module(ModuleManager.BaseModule):
page = utils.http.request(API % location["timezone"], json=True)
if page and page.data and not page.data.get("error", None):
+ iso8601 = page.data["datetime"]
+ iso8601_dt, sep, timezone = iso8601.partition("+")
+ if sep:
+ iso8601 = "%s+%s" % (
+ iso8601_dt, timezone.replace(":", "", 1))
+
dt = utils.iso8601_parse(page.data["datetime"],
microseconds=True)
human = utils.datetime_human(dt)