def bson.timestamp.Timestamp.__init__ |
( |
|
self, |
|
|
|
time, |
|
|
|
inc |
|
) |
| |
Create a new :class:`Timestamp`.
Raises :class:`TypeError` if `time` is not an instance of
:class: `int` or :class:`~datetime.datetime`, or `inc` is not
an instance of :class:`int`. Raises :class:`ValueError` if
`time` or `inc` is not in [-2**31, 2**31).
:Parameters:
- `time`: time in seconds since epoch UTC, or a naive UTC
:class:`~datetime.datetime`, or an aware
:class:`~datetime.datetime`
- `inc`: the incrementing counter
.. versionchanged:: 1.7
`time` can now be a :class:`~datetime.datetime` instance.
def bson.timestamp.Timestamp.as_datetime |
( |
|
self | ) |
|
Return a :class:`~datetime.datetime` instance corresponding
to the time portion of this :class:`Timestamp`.
.. versionchanged:: 1.8
The returned datetime is now timezone aware.
def bson.timestamp.Timestamp.inc |
( |
|
self | ) |
|
Get the inc portion of this :class:`Timestamp`.
def bson.timestamp.Timestamp.time |
( |
|
self | ) |
|
Get the time portion of this :class:`Timestamp`.
The documentation for this class was generated from the following file: