Skip to content

Commit

Permalink
add __str__ to DateTime for easier introspection (#487)
Browse files Browse the repository at this point in the history
Take advantage of Date and Time __str__ methods
  • Loading branch information
Safrone authored Jan 22, 2025
1 parent fe00d34 commit df6476c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions py34/bacpypes/basetypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2233,6 +2233,9 @@ class DateTime(Sequence):
, Element('time', Time)
]

def __str__(self):
return "%s(date=%s, time=%s)" % (self.__class__.__name__, self.date, self.time)

class DateRange(Sequence):
sequenceElements = \
[ Element('startDate', Date)
Expand Down

0 comments on commit df6476c

Please sign in to comment.