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!

Best Answer

  • pf
    pf LSEG
    Answer ✓

    tzlocal must be imported from datetime.tz.

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

Answers