SequoiaDB
 All Classes Functions
Public Member Functions | List of all members
bson.timestamp.Timestamp Class Reference
Inheritance diagram for bson.timestamp.Timestamp:

Public Member Functions

def __init__
 
def time
 
def inc
 
def __eq__
 
def __ne__
 
def __lt__
 
def __le__
 
def __gt__
 
def __ge__
 
def __repr__
 
def as_datetime
 

Detailed Description

Timestamp of bson

Constructor & Destructor Documentation

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.

Member Function Documentation

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: