From 105aa65f2117bd3af42292cf1a5f90abd0f78323 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Tue, 3 Mar 2020 22:19:23 +0100 Subject: Correct an issue on Windows, time zone not display correctly. Skip it for the moment --- glances/plugins/glances_now.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/glances/plugins/glances_now.py b/glances/plugins/glances_now.py index 85f4ece1..c549335a 100644 --- a/glances/plugins/glances_now.py +++ b/glances/plugins/glances_now.py @@ -22,6 +22,7 @@ from time import tzname, localtime from datetime import datetime +from glances.globals import WINDOWS from glances.plugins.glances_plugin import GlancesPlugin @@ -49,11 +50,12 @@ class Plugin(GlancesPlugin): """Update current date/time.""" # Had to convert it to string because datetime is not JSON serializable self.stats = datetime.now().strftime('%Y-%m-%d %H:%M:%S') - # Add the time zone (issue #1249 and issue #1337) - if 'tmzone' in localtime(): - self.stats += ' {}'.format(localtime().tm_zone) - elif len(tzname) > 0: - self.stats += ' {}'.format(tzname[1]) + # Add the time zone (issue #1249 / #1337 / #1598) + if not WINDOWS: + if 'tmzone' in localtime(): + self.stats += ' {}'.format(localtime().tm_zone) + elif len(tzname) > 0: + self.stats += ' {}'.format(tzname[1]) return self.stats -- cgit v1.2.3