From 659c0c3073e33e2a7cc2d4ce6768e29ff81f5809 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Sat, 4 May 2019 07:49:53 +0000 Subject: [PATCH] - improved time output git-svn-id: http://moon:8086/svn/projects/HendiControl@287 fda53097-d464-4ada-af97-ba876c37ca34 --- Control/brewpi/astirrer.py | 3 ++- Control/brewpi/controller.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Control/brewpi/astirrer.py b/Control/brewpi/astirrer.py index d6f7dcb..d4b67e6 100644 --- a/Control/brewpi/astirrer.py +++ b/Control/brewpi/astirrer.py @@ -12,7 +12,8 @@ class AStirrer(abc.ABC): self.isOn = 1 def log(self, s): - print("{:.2f}: {}".format(time.time(), s)) + now = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime()) + print("{}: {}".format(now, s)) def process(self): isOn = self.isOn diff --git a/Control/brewpi/controller.py b/Control/brewpi/controller.py index 1686336..31ff17c 100644 --- a/Control/brewpi/controller.py +++ b/Control/brewpi/controller.py @@ -129,8 +129,8 @@ class Controller(TimerListener): self.log("Wait user input!") def log(self, s): - now = time.time() - print("{:.2f}: {}".format(now, s)) + now = time.strftime("%a, %d %b %Y %H:%M:%S", time.localtime()) + print("{}: {}".format(now, s)) def report(self): self.log("Temp SOLL {} °C".format(self.ctrl_theta_soll))