improve date conversion