question

Upvotes
Accepted
13 3 2 7

EMA DataType Conversion

Following a EMA demo session with clients, they want to know if there is any method available to convert com.thomsonreuters.ema.access.DataType.DataTypes#DATETIME to java.time.LocalDateTime, and vice verse. Can anyone help with it? Thanks.

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hello @tony.zhu

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If yes, please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS


Upvotes
Accepted
9.6k 10 7 7

Hello @tony.zhu

According to my finding, EMA does not provide any method to convert com.thomsonreuters.ema.access.DataType.DataTypes#DATETIME to java.time.LocalDateTime, and vice verse. The application has to do this by itself.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvote
1.5k 5 6 7

Converting to java.time.Instant would be more appropriate. This is because the content of a DATETIME field is meant to a UTC value. Converting to LocalDateTime would be incorrect, IMO.


Of course, it cannot be guaranteed that there wouldn't be someone out there who hasn't read the documentation and therefore would be publishing some local timezone value into a DATETIME field. However, I still think that - in the absence of other information - you should trust that publishers of information are in fact obeying by the convention.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.