Inquiry about the inter-day problem of converting Reuters date to Beijing date

zero
zero Newcomer

The exchange rate quotes sent by Reuters have separate date fields for askdate and biddate;

When using the toDate() method of the RFA api to convert these two times to Beijing time, no 1 is added in the case of inter-day.

For example, if a "EUR=" rate quote is sent on 2023-03-21 23:00:00 GMT.

The value of the askdate field is 2023-03-21, which should be 2023-03-22 when converted to BST.

But the current date after conversion is still 2023-03-21

The conversion code is shown below:

        OMMData data = entry.getData(def.getOMMType());        OMMDateTime dt = (OMMDateTime)data;        // Since the date field does not carry a time, the default is 00:00:00        // So when the time sent by Reuters is converted to Beijing time,         // the date will never cross the day        Date date = dt.toDate();

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @zero

    Thanks for reaching out to us.

    I checked the data and I am unable to find any field in EUR= that contains both Date and Time data.

    I found the date fields that contain dates (DD MMM YYYY) and the time fields that contain times in GMT.

    1679562349307.png

    If you called toDate() on the date fields, you will get that date. It will not be converted to another date according to the time zone because it doesn't contain time data.

    Therefore, you may need to get a time field and convert it according to your timezone. Then, if the converted time is for the next day, you need to add one to the date field.

    However, if you use another field that contains both date and time, please let me know.

    I hope that this information is of help


Answers