Update of date conversion function to handle timestamps