added a function to format dates to common