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
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛