For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 0 1 2

How do I set the "CF_TIME" field in the EIKON API to the time zone I live in?

The first picture is the data I received from Excel using CF_LAST, CF_TIME, and CF_DATE. 
In the second picture, I received data of the same field using the EIKON API.
 
In the case of Excel, CF_TIME and CF_DATE are automatically set to the time zone of Korea where I live. 
However, for the EIKON API, CF_TIME and CF_DATE seem to follow the GMT time zone.
 
How do I set CF_TIME and CF_DATE in the EIKON API to the time zone of Korea where I live?
eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikon
icon clock
10 |1500

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

1 Answer

Upvote
Accepted
39.2k 75 11 27

Eikon Data APIs return all timestamps in UTC. You can use pandas capabilities to convert timestamp to the timezone of your choice. The following example adds a column to your dataframe containing pandas Timestamp objects created using date and time strings in columns CF_DATE and CF_TIME, adds timezone info to these objects and converts the timezone to Seoul.

df['Timestamp'] = pd.to_datetime(df['CF_DATE']+'T'+df['CF_TIME']) \
                    .dt.tz_localize('UTC').dt.tz_convert('Asia/Seoul')
icon clock
10 |1500

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

Thank you very much. Have a nice day.
Click below to post an Idea Post Idea