Formatting dates for DB.