Where did o 'clock for the time of the day come from?

O'clock is a contraction of 'of the clock' so it is a short way to say the time is three of the clock or whatever time being refered to.