Skip to content

Commit d360f21

Browse files
Improved ticks string formatting
1 parent 90836a7 commit d360f21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sttp/ticks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ def to_string(ticks: np.uint64, timespec: str = 'microseconds') -> str:
165165
"""
166166
Standard timestamp representation for a Ticks value, e.g., 2006-01-02 15:04:05.999999999.
167167
"""
168-
return Ticks.to_datetime(ticks).isoformat(sep=' ', timespec=timespec)
168+
return Ticks.to_datetime(ticks).isoformat(sep=' ', timespec=timespec).split("+")[0]
169169

170170
@staticmethod
171171
def to_shortstring(ticks: np.uint64) -> str:
172172
"""
173173
Shows just the timestamp portion of a Ticks value with milliseconds, e.g., 15:04:05.999.
174174
"""
175-
return Ticks.to_string(ticks, "milliseconds").split("+")[0]
175+
return Ticks.to_string(ticks, "milliseconds").split(" ")[1]

0 commit comments

Comments
 (0)