conditional date conversion