def _to_date(rs, col):
    """Fix date-to-string conversion in JayDeBeApi

    Dates before the year 1900 are not correctly converted to strings by
    JayDeBeApi.  This is caused by an exception in
    datetime.datetime.strftime.  The conversion is fixed with this helper
    function.
    """

    java_val = rs.getDate(col)
    if not java_val:
        return None
    return str(java_val)[:10]