Skip to content

Commit 148921a

Browse files
bessmanhardbyte
authored andcommitted
Fix date format to show correct day of month (hardbyte#754)
%m is month as a zero-padded decimal number %d is day of the month as a zero-padded decimal number
1 parent dcd694e commit 148921a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

can/io/asc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class ASCWriter(BaseIOHandler, Listener):
147147
"{bit_timing_conf_ext_data:>8}",
148148
]
149149
)
150-
FORMAT_DATE = "%a %b %m %I:%M:%S.{} %p %Y"
150+
FORMAT_DATE = "%a %b %d %I:%M:%S.{} %p %Y"
151151
FORMAT_EVENT = "{timestamp: 9.6f} {message}\n"
152152

153153
def __init__(self, file, channel=1):
@@ -162,7 +162,7 @@ def __init__(self, file, channel=1):
162162
self.channel = channel
163163

164164
# write start of file header
165-
now = datetime.now().strftime("%a %b %m %I:%M:%S.%f %p %Y")
165+
now = datetime.now().strftime("%a %b %d %I:%M:%S.%f %p %Y")
166166
self.file.write("date %s\n" % now)
167167
self.file.write("base hex timestamps absolute\n")
168168
self.file.write("internal events logged\n")

0 commit comments

Comments
 (0)