INNER CODE UNIT · Python
ms_to_time
baileydanseglio/thetadata-python · thetadata/client.py:44
def ms_to_time(ms_of_day: int) -> datetime.time:
"""Converts milliseconds of day to a time object."""
return datetime(year=2000, month=1, day=1, hour=int((ms_of_day / (1000 * 60 * 60)) % 24),
minute=int(ms_of_day / (1000 * 60)) % 60, second=int((ms_of_day / 1000) % 60),
microsecond=(ms_of_day % 1000) * 1000).time()
_pt_to_price_mul = [
0,
0.000000001,
0.00000001,
0.0000001,
0.000001,
0.00001,
0.0001,
0.001,
0.01,
0.1,