Fixed datetime to date conversion