@staticmethod
    def serialize(val, protocol_version):
        try:
            days = val.days_from_epoch
        except __HOLE__:
            if isinstance(val, six.integer_types):
                # the DB wants offset int values, but util.Date init takes days from epoch
                # here we assume int values are offset, as they would appear in CQL
                # short circuit to avoid subtracting just to add offset
                return uint32_pack(val)
            days = util.Date(val).days_from_epoch
        return uint32_pack(days + SimpleDateType.EPOCH_OFFSET_DAYS)
dataset/ETHPy150Open datastax/python-driver/cassandra/cqltypes.py/SimpleDateType.serialize