Did you know that these two expressions have completely different meanings? Когда-нибудь means “sometime in the future”, “somewhen”, “some day or other”. Как-нибудь is a synonym of когда-нибудь, normallyused in colloquial speech. Когда-то means “once”, “in former times”, so it always refers to the past.
Когда-нибудь мы наконец встретимся! We will finally meet sometime.
Когда-то наши предки пришли из деревни в город. In former times, our ancestors came from the village to the town.