fixed get_nearest_time bugs.