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

imageimage

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?

Best Answer

  • 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')

Answers