def forgiving_as_timestamp(value):
    'Try to convert value to timestamp.'
    try:
        return dt_util.as_timestamp(value)
    except (ValueError, TypeError):
        return None
Try to convert value to timestamp.
def forgiving_as_timestamp(value):
    
    try:
        return dt_util.as_timestamp(value)
    except (ValueError, TypeError):
        return None