Skip to content

Commit

Permalink
Fix date format to show correct day of month (#754)
Browse files Browse the repository at this point in the history
%m is month as a zero-padded decimal number
%d is day of the month as a zero-padded decimal number
  • Loading branch information
bessman authored and hardbyte committed Jan 7, 2020
1 parent dcd694e commit 148921a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions can/io/asc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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")
Expand Down

0 comments on commit 148921a

Please sign in to comment.