def _serialize(self, value, attr, obj):
        """
        Serialize value as a timestamp, either as a Unix timestamp (in float second) or a UTC isoformat string.

        """
        if value is None:
            return None

        if self.use_isoformat:
            return datetime.utcfromtimestamp(value).isoformat()
        else:
            return value
Serialize value as a timestamp, either as a Unix timestamp (in float second) or a UTC isoformat string.