added a date conversion method