Open lsharples1 opened 2 years ago
As a follow up, I would like to see if there is a recommended way within the python SDK to take the trackingID and return the timestamp. I have seen that the Java SDK there is a getTimestamp method. However, upon running this method with a trackingID the getTimestamp() method is returning the same as the trackingID (see attached image).
Alternatively, I have tried a python program to convert the timestamp to hex and attempting to take the 2-7 bytes for the timestamp: example trackingID = 42900650493027, converted to hex bytes 0x270496088463, in bytes 0x63, 0x84, 0x08, 0x96, 0x04, 0x27
where there are only 6 bytes.
Please see below for converting trackingID to timestamp in python:
def get_timestamp(tracking_id):
return tracking_id & 0xffffffffffff
def get_counter(tracking_id):
return tracking_id >> 48
In most cases, the returned value is going to be the same as the trackingID. In addition, the returned value is nanoseconds from midnight
in EST (same timezone as New York).
In the Nasdaq Basic docs, I am seeing that "TrackingNumber/trackingID" for a quote is composed of the Nasdaq internal tracking number and the Timestamp in nanoseconds from midnight. I need to access the unix timestamp of this quote, and wanted to first see if there was a better way to access this than from manipulating the trackingID?
If not, I would like to confirm that the Timestamp in nanoseconds from midnight is assuming UTC?
Thanks.