(self, value)
return value.replace(microsecond=0).strftime(self.dateformat)
Encodes a `DataObject` attribute (a Python `datetime` instance)
        into a timestamp string.

        The `datetime` instance should have no time zone set. Timestamp
        strings will be of the format ``YYYY-MM-DDTHH:MM:SSZ``.
Encodes a `DataObject` attribute (a Python `datetime` instance)
        into a timestamp string.
Encodes a DataObject attribute ( a Python datetime instance ) into a timestamp string .
def encode(self, value):
        """Encodes a `DataObject` attribute (a Python `datetime` instance)
        into a timestamp string.

        The `datetime` instance should have no time zone set. Timestamp
        strings will be of the format ``YYYY-MM-DDTHH:MM:SSZ``.

        """
        if not isinstance(value, datetime):
            raise TypeError('Value to encode %r is not a datetime' % (value,))
        if value.tzinfo is not None:
            value = value.astimezone(Datetime.utc)
        return value.replace(microsecond=0).strftime(self.dateformat)
def encode ( self , value ) : if not isinstance ( value , datetime ) : raise TypeError ( 'Value to encode %r is not a datetime' % ( value , ) ) if value . tzinfo is not None : value = value . astimezone ( Datetime . utc ) return value . replace ( microsecond = 0 ) . strftime ( self . dateformat )