Format date and code