Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
166 13 18 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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apitime-series
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.

1 Answer

· Write an 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 512.0 KiB each and 1.0 MiB total.

That works. Thanks!

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

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.