putting date in correct format