blpapi.FixedOffset

class blpapi.FixedOffset

Time zone information.

Represents time zone information to be used with Python standard library datetime classes.

This class is intended to be used as tzinfo for Python standard library datetime.datetime and datetime.time classes. These classes are accepted by the blpapi package to set DATE, TIME or DATETIME elements. For example, the DATETIME element of a request could be set as:

value = datetime.datetime(1941, 6, 22, 4, 0, tzinfo=FixedOffset(4*60))
request.getElement("last_trade").setValue(value)

The TIME element could be set in a similar way:

value = datetime.time(9, 0, 1, tzinfo=FixedOffset(-5*60))
request.getElement("session_open").setValue(value)

Note that you could use any other implementations of datetime.tzinfo with BLPAPI-Py, for example the widely used pytz package (https://pypi.python.org/pypi/pytz/).

For more details see datetime module documentation at https://docs.python.org/library/datetime.html

__init__(offsetInMinutes=0)
Parameters

offsetInMinutes (int) – Offset from UTC in minutes

Creates an object that implements datetime.tzinfo interface and represents a timezone with the specified offsetInMinutes from UTC.

dst(dt)

datetime -> DST offset in minutes east of UTC.

fromutc()

datetime in UTC -> datetime in local time.

getOffsetInMinutes()
Returns

Offset from UTC in minutes

Return type

int

tzname(dt)

datetime -> string name of time zone.

utcoffset(dt)

datetime -> timedelta showing offset from UTC, negative values indicating West of UTC