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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
166 10 17 21

Eikon API: Time Zone in Time Series

How to use time zones in Time Series requests? The following example code does not work (on Windows 7 with Eikon 0.1.9 package):

req = eikon.get_timeseries(["MSFT.O"],["CLOSE"], start_date=datetime.datetime(2017, 1, 3, 7, 12, 30, 214000, tzinfo=tzlocal()), end_date=datetime.datetime(2017, 4, 13, 7, 12, 30, 214000, tzinfo=tzlocal()), interval="daily")

It results in the following error:

NameError: name 'tzlocal' is not defined

Can we please update the documentation? Thanks!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythontime-series
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
4.3k 2 4 5

tzlocal must be imported from datetime.tz.

Add this line in your script then it should work:
from dateutil.tz import tzlocal

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.

That works. Thanks!

Perhaps we should mention it in the documentation, it might be confusing for some.

Click below to post an Idea Post Idea