Skip to content

Commit

Permalink
implement __eq__ for TdmsTimestamp type
Browse files Browse the repository at this point in the history
  • Loading branch information
jimkring committed Jan 24, 2024
1 parent 077a009 commit 5cd13a9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nptdms/timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def __str__(self):
fraction_string = "{0:.6f}".format(self.second_fractions * 2.0 ** -64).split('.')[1]
return "{0}.{1}".format(dt, fraction_string)

def __eq__(self, other):
return self.seconds == other.seconds and self.second_fractions == other.second_fractions

def as_datetime64(self, resolution='us'):
""" Convert this timestamp to a numpy datetime64 object
Expand Down

0 comments on commit 5cd13a9

Please sign in to comment.