Rewrite the relative_date util function using only the standard datetime module.