def encode(self, value):
        """encode(value) -> bytearray

        Encodes the given value to a bytearray according to this
        ComplexType definition.
        """
        if type(value) is not datetime.datetime:
            raise TypeError('encode() argument must be a Python datetime')

        return super(Time32Type, self).encode( dmc.toGPSSeconds(value) )