“The `o’ is actually a contraction of `of’. In the old days when someone asked an individual for the time, he would reply `eleven of the clock’. So instead of eleven o’clock, they used to say `eleven of the clock’.
At times, they dropped `the’ and shortened the reply to `eleven of clock’. After some time, people began dropping the `f ‘ sound in `of ‘. So `of clock’ became `o’clock’.