From aaa2b2d3239d9dcf7480d1b2b3c8133235beefab Mon Sep 17 00:00:00 2001 From: Alexander Bessman Date: Tue, 7 Jan 2020 13:11:15 +0100 Subject: [PATCH] Fix date format to show correct day of month %m is month as a zero-padded decimal number %d is day of the month as a zero-padded decimal number --- can/io/asc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/can/io/asc.py b/can/io/asc.py index 9d854ab0f..c83458ab4 100644 --- a/can/io/asc.py +++ b/can/io/asc.py @@ -147,7 +147,7 @@ class ASCWriter(BaseIOHandler, Listener): "{bit_timing_conf_ext_data:>8}", ] ) - FORMAT_DATE = "%a %b %m %I:%M:%S.{} %p %Y" + FORMAT_DATE = "%a %b %d %I:%M:%S.{} %p %Y" FORMAT_EVENT = "{timestamp: 9.6f} {message}\n" def __init__(self, file, channel=1): @@ -162,7 +162,7 @@ def __init__(self, file, channel=1): self.channel = channel # write start of file header - now = datetime.now().strftime("%a %b %m %I:%M:%S.%f %p %Y") + now = datetime.now().strftime("%a %b %d %I:%M:%S.%f %p %Y") self.file.write("date %s\n" % now) self.file.write("base hex timestamps absolute\n") self.file.write("internal events logged\n")