converting date to correct format