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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
27 2 1 6

How to return local exchange time in time series?

I use the following code to get data:

df1=ek.get_timeseries('2330.TW',fields=["Open","High","Low","Close","Volume"], start_date = "2018-08-02T01:00:00" ,end_date='2018-10-27T23:00:00',interval='minute')

but it does not return the local time format , it should be Taiwan timezone, how to fix it ,

Thanks

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythontime-zone
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
111 2 4 8

Hi,

Please try to convert the return dataframe to your desired timezone.

import pytz

eastern = pytz.timezone('Asia/Shanghai')

df.index = df.index.tz_localize(pytz.utc).tz_convert(eastern)

Thanks.

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.

thanks , it is very helpful.

Click below to post an Idea Post Idea