diff options
| author | 2019-09-04 10:29:05 +0100 | |
|---|---|---|
| committer | 2019-09-04 10:29:05 +0100 | |
| commit | c4428e479f47fc3a6df09eb3c340c196b47243ae (patch) | |
| tree | 524afe27a60d81dd1b0b718612faf0bcb74404fc | |
| parent | correctly qualify DeadlineExceededException namespace (diff) | |
| signature | ||
Force removal of ":" from user_time.py API-provided ISO8601
| -rw-r--r-- | modules/user_time.py | 6 |
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) |
