otp.Milli#

Milli(n)#

onetick.py object representing Milli datetime offset. Can be added to or subtracted from:

Parameters

n (int, otp.Column) – offset integer value or column of otp.Source

Examples

Add to or subtract from otp.datetime object:

>>> otp.datetime(2012, 12, 12, 12) + otp.Milli(1)
2012-12-12 12:00:00.001000
>>> otp.datetime(2012, 12, 12, 12) - otp.Milli(1)
2012-12-12 11:59:59.999000

Use offset in columns:

>>> t = otp.Tick(A=1)
>>> t['T'] = otp.datetime(2012, 12, 12, 12)
>>> t['T'] += otp.Milli(t['A'])
>>> otp.run(t)
        Time                       T  A
0 2003-12-01 2012-12-12 12:00:00.001  1