diff options
| author | 2019-12-30 17:18:54 +0000 | |
|---|---|---|
| committer | 2019-12-30 17:18:54 +0000 | |
| commit | 6380e80282bfd3a397e5a21c4dbacdc339a2d6f2 (patch) | |
| tree | debd53e905ce506f3caec3d0ee38436bb604762b /modules/user_time.py | |
| parent | add time-localise export in user_time, to timezone localise a datetime (diff) | |
| signature | ||
don't use .replace for timezone, use .astimezone
Diffstat (limited to 'modules/user_time.py')
| -rw-r--r-- | modules/user_time.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/user_time.py b/modules/user_time.py index d17c2a52..3be0f651 100644 --- a/modules/user_time.py +++ b/modules/user_time.py @@ -45,7 +45,7 @@ class Module(ModuleManager.BaseModule): return LocationType.NAME, event["args"], None def _timezoned(self, dt, timezone): - dt = dt.replace(tzinfo=pytz.timezone(timezone)) + dt = dt.astimezone(pytz.timezone(timezone)) utc_offset = (dt.utcoffset().total_seconds()/60)/60 tz = "UTC" if not utc_offset == 0.0: |
