Skip to content

Commit 7d5bd88

Browse files
authored
Fixed bug for timestamps with leading zeros for microseconds. (#27)
1 parent 0dcc762 commit 7d5bd88

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

async_rithmic/plants/base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,7 @@ def _datetime_to_utc(self, dt: datetime):
556556
return dt
557557

558558
def _ssboe_usecs_to_datetime(self, ssboe: int, usecs: int):
559-
ts = '{0}.{1}'.format(ssboe, usecs)
560-
return datetime.fromtimestamp(float(ts), tz=pytz.utc)
559+
return datetime.fromtimestamp(ssboe, tz=pytz.utc).replace(microsecond=usecs)
561560

562561
def _datetime_to_ssboe_usecs(self, dt: datetime):
563562
"""

0 commit comments

Comments
 (0)