tz_util – Utilities for dealing with timezones in Python

Timezone related utilities for BSON.

  • class bson.tzutil.FixedOffset(_offset, name)
  • Fixed offset timezone, in minutes east from UTC.

Implementation based from the Python standard library documentation.Defining getinitargs enables pickling / copying.

  • dst(dt)
  • datetime -> DST offset in minutes east of UTC.

  • tzname(dt)

  • datetime -> string name of time zone.

  • utcoffset(dt)

  • datetime -> minutes east of UTC (negative for west of UTC).
  • bson.tzutil.utc = _
  • Fixed offset timezone representing UTC.