reintroduced function convert_date(), see comment in source