Test date conversion function