For a deeper look into our Eikon Data API, look into:
Overview | Quickstart | Documentation | Downloads | Tutorials | Articles
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!
tzlocal must be imported from datetime.tz.
Add this line in your script then it should work:
from dateutil.tz import tzlocal
That works. Thanks!
Perhaps we should mention it in the documentation, it might be confusing for some.