提交 e3e1aaf3 编写于 作者: N nicolargo

Add time zone to the current time #1249

上级 aafcb63b
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册