OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, time, inc) |
def | time (self) |
def | inc (self) |
def | __eq__ (self, other) |
def | __hash__ (self) |
def | __ne__ (self, other) |
def | __lt__ (self, other) |
def | __le__ (self, other) |
def | __gt__ (self, other) |
def | __ge__ (self, other) |
def | __repr__ (self) |
def | as_datetime (self) |
MongoDB internal timestamps used in the opLog.
def __init__ | ( | self, | |
time, | |||
inc | |||
) |
Create a new :class:`Timestamp`. This class is only for use with the MongoDB opLog. If you need to store a regular timestamp, please use a :class:`~datetime.datetime`. 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 [0, 2**32). :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
def __eq__ | ( | self, | |
other | |||
) |
def __ge__ | ( | self, | |
other | |||
) |
def __gt__ | ( | self, | |
other | |||
) |
def __hash__ | ( | self | ) |
def __le__ | ( | self, | |
other | |||
) |
def __lt__ | ( | self, | |
other | |||
) |
def __ne__ | ( | self, | |
other | |||
) |
def __repr__ | ( | self | ) |
def as_datetime | ( | self | ) |
Return a :class:`~datetime.datetime` instance corresponding to the time portion of this :class:`Timestamp`. The returned datetime's timezone is UTC.
def inc | ( | self | ) |
Get the inc portion of this :class:`Timestamp`.
def time | ( | self | ) |
Get the time portion of this :class:`Timestamp`.