Add time zone to the current time #1249

pull/1263/head
nicolargo 2018-04-08 14:28:39 +02:00
parent aafcb63b29
commit e3e1aaf303
2 changed files with 4 additions and 0 deletions

1
NEWS
View File

@ -24,6 +24,7 @@ Enhancements and new features:
* Display debug message if dep lib is not found #1224
* Add a new output mode to stdout #1168
* Huge refactor of the WebUI packaging thanks to @spike008t #1239
* Add time zone to the current time #1249
One more thing ! A new Grafana Dash is available with:
* Network interface variable

View File

@ -19,6 +19,7 @@
"""Now (current date) plugin."""
from time import tzname
from datetime import datetime
from glances.plugins.glances_plugin import GlancesPlugin
@ -48,6 +49,8 @@ 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)
self.stats += ' {}'.format(tzname[0])
return self.stats