Add date conversion functions and associated tests.