modify any key-value pair where value is a datetime object to a string.
347918
def _convert_datetime_str(response):
    '''
    
    '''
    if response:
        return dict([(k, '{0}'.format(v)) if isinstance(v, datetime.date) else (k, v) for k, v in six.iteritems(response)])
    return None
5750
def _serialize(self, value, attr, obj, **kwargs):
        """"""
        if value is None:
            return None

        return int(datetime_to_timestamp(value))
203629
def _convert_date_time_string(dt_string):
    '''
    
    '''
    dt_string = dt_string.split('.')[0]
    dt_obj = datetime.strptime(dt_string, '%Y%m%d%H%M%S')
    return dt_obj.strftime('%Y-%m-%d %H:%M:%S')
721896
public static DateTime toDate(String str, boolean alsoNumbers, TimeZone tz, DateTime defaultValue) {
	return DateCaster.toDateAdvanced(str, alsoNumbers ? DateCaster.CONVERTING_TYPE_OFFSET : DateCaster.CONVERTING_TYPE_NONE, tz, defaultValue);
    }
581486
def convert(self, key, value):
        """"""
        if key not in self._dtypes:
            self.read_types()
            if key not in self._dtypes:
                name = utils.name(value)
                serializer = utils.serializer(name)
                deserializer = utils.deserializer(name)
                self._dtypes[key] = (name, serializer, deserializer)
                with self.db:
                    self.db.execute("replace into value_types (key, value_type) values (?, ?)", (key, name))
        return self._dtypes[key][1](value)
89729
def _parse_datetime_value(value):
    """"""
    if value.endswith('Z'):
        # Arrow doesn't support the "Z" literal to denote UTC time.
        # Strip the "Z" and add an explicit time zone instead.
        value = value[:-1] + '+00:00'

    return arrow.get(value, 'YYYY-MM-DDTHH:mm:ssZ').datetime
1346269
def transformFromNative(obj):
        
        if type(obj.value) == datetime.date:
            obj.isNative = False
            obj.value_param = 'DATE'
            obj.value = dateToString(obj.value)
            return obj
        else:
            return DateTimeBehavior.transformFromNative(obj)
345673
def todate(val):
    '''
    '''
    if not val:
        raise ValueError("Value not provided")
    if isinstance(val, datetime):
        return val.date()
    elif isinstance(val, date):
        return val
    else:
        try:
            ival = int(val)
            sval = str(ival)
            if len(sval) == 8:
                return yyyymmdd2date(val)
            elif len(sval) == 5:
                return juldate2date(val)
            else:
                raise ValueError
        except Exception:
            # Try to convert using the parsing algorithm
            try:
                return date_from_string(val).date()
            except Exception:
                raise ValueError("Could not convert %s to date" % val)
732236
def _date_to_datetime(value):
  
  if not isinstance(value, datetime.date):
    raise TypeError('Cannot convert to datetime expected date value; '
                    'received %s' % value)
  return datetime.datetime(value.year, value.month, value.day)
1149217
public static DateTime copy(DateTime value) {
        if (value == null) {
            return null;
        } else {
            return new DateTime(value.getMillis(), DateTimeZone.UTC);
        }
    }
489329
def get_as_datetime(self, key):
        
        value = self.get(key)
        return DateTimeConverter.to_datetime(value)
1345500
def strip_datetime(value):
        
        if isinstance(value, basestring):
            try:
                return parse_datetime(value)
            except ValueError:
                return
        elif isinstance(value, integer_types):
            try:
                return datetime.datetime.utcfromtimestamp(value / 1e3)
            except (ValueError, OverflowError, OSError):
                return
270896
@NonNull
    @Override
    public MutableDictionary setDate(@NonNull String key, Date value) {
        return setValue(key, value);
    }
310703
def set_value(self, value: datetime):
        
        assert isinstance(value, datetime)

        self.value = value
302225
def parse_value(self, value):
        """"""
        if value is None:
            return value
        if isinstance(value, datetime.time):
            return value
        return parse(value).timetz()
768209
def _converter(self, value):
        """"""
        if not isinstance(value, datetime.date):
            raise TypeError('{0} is not valid date'.format(value))
        return value
30995
def stringify(self, value, **opts):
        
        if self._is_null(value):
            return None
        try:
            opts_ = self.opts.copy()
            opts_.update(opts)
            return self._stringify(value, **opts_)
        except Exception as e:
            if not isinstance(e, ConverterError):
                e = ConverterError(None, exc=e)
            e.converter = self.__class__
            raise e