How to identify and convert millisecond _MS time fields ?
I would like to convert the millisecond time field (ex: SALTIM_MS, QUOTIM_MS, ...) that are stored as unsigned integers to HH:MM:SS.mmm format. As the RWF field type for these fields are UINT64, they can't be easily identified as time fields during decoding of the message.
- What is TR's recommended way to identify the millisecond fields that need special conversion logic ?
- Does the ETA API provide an utility method to convert millisecond data to string format HH:MM:SS.mmm ?
- If the API doesn't provide a method to identify and convert millisecond time fields, is it safe to look for the suffix "_MS" on any of the field name and apply conversion logic to extract HH, MM, SS and millisecond data ? In other words, I don't want to leave out a time field with out the suffix _MS that has a millisecond value stored as integer.
Best Answer
-
Yes, you need to use both the suffix "_MS" and UINT64 to identify those fields because there are others fields which have suffix "_MS" and TIME as a RWF type.
TRDTIM_MS "TRDTIM MS" 3853 NULL INTEGER 15 UINT64 4
SALTIM_MS "SALTIM MS" 3854 NULL INTEGER 15 UINT64 4
QUOTIM_MS "QUOTIM MS" 3855 NULL INTEGER 15 UINT64 4
TIMCOR_MS "TIMCOR MS" 3856 NULL INTEGER 15 UINT64 4
...
...
EURO_AL_MS "EURO ASK LOW TIME" 14169 NULL INTEGER 15 TIME 5
EURO_AO_MS "EURO ASK OPEN TIME" 14170 NULL INTEGER 15 TIME 5
EURO_BH_MS "EURO BID HIGH TIME" 14171 NULL INTEGER 15 TIME 5The values in those fields (with suffix "_MS" and UINT64) represent time stamp in milliseconds within a day. You can use the below logic to convert milliseconds within a day to time.
int msec = time_ms%1000;
int seconds = (((int)(time_ms/1000)) % 60);
int minutes = (((int)(time_ms/60000)) % 60);
int hours = (((int)(time_ms/3600000)) % 24);0
Answers
-
Due to an outage of the Thomson Reuters Developer
Community email notification system from 2:30 PM CDT on November 29th until
9:00 AM CDT on November 30th we are posting to all questions updated during
this timeframe in order to ensure all customers receive all relevant email
updates. Please review this question, and its associated answers, in order to
ensure you are aware of any possible updates that may have occurred during this
outage. We apologize for the delay and any inconvenience this has caused.Matthew Logterman, J.D.
Sr. Product Manager, Thomson Reuters Developer Community
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 249 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛