fix get_localized_time when datetime is none