From ancient times in Japan, time was expressed by the duodecimal system introduced from China. The hour from eleven p.m. to one a.m. was the Hour of the Rat (子の刻, ne no koku). From one a.m. to three a.m. was The Hour of the Ox (丑の刻の刻, ushi no koku); three a.m. to five in the morning was The Hour of the Tiger (虎の刻, tora no koku); and so on.
Moreover, in the Edo Period a bell was rung to announce the hour, so the hour of the day was also known by the number of times the bell was rung. At midnight and noon, the bell was rung nine times. The clock was struck every koku (刻), about once every two hours or so: nine times at noon (九つ, kokonotsu), eight times around two in the afternoon (八つ, yattsu), seven times around four-thirty in the afternoon (七つ, nanatsu), and six times at sunset (暮れ六つ, kuremutsu, lit. “twilight six”). An interesting vestige of this former system, snacks and snack time are still called o-yattsu (お八つ) and o-yattsu no jikan (お八つの時間) today. Around nine in the evening, the bell was rung five times (五つ, itsutsu); at about ten-thirty at night, it was rung four times (四つ, yottsu). And at midnight, the bell was run nine times again. In this way, the bell was rung every two hours or so, first nine times, then eight, seven, six, five, four, and then nine times again.
Another vestige of this the former system is the use of the kanji for “horse” in telling time today. Twelve noon is called shōgo (正午, lit. “exactly horse”) because eleven a.m. to 1 p.m. used to be the Hour of the Horse. Anti meridiem, or a.m., today is gozen (午前, lit. “before the horse”) and post meridiem, or p.m., is gogo (午後, “after the horse”).
Another peculiarity of the former time-telling system was that although night and day was divided into twelve koku or parts, with six always referring to the sunrise and sunset. The length of the koku or “hours” varied throughout the year, such that the daytime koku were longer in the summer months and shorter in the winter months.
Because one koku was on average two hours long, each koku was divided into quarters, lasting an average of thirty minutes (Ex.: 辰の一刻, tatsu no ikkoku; 丑の三つ, ushi no mitsu) or thirds (Ex.: 寅の上刻, tora no jōkoku; 卯の下刻, u no gekoku). Night and day was also divided into 100 koku. On the spring and autumn equinoxes, day and night were both 50 koku long. On the summer solstice, daytime measured 60 koku and night 40. On the winter solstice, the opposite was true.
One last interesting factoid: each domain kept its own time with noon being the time that the sun was highest in the sky. When trains were first introduced to Japan, it was not unusual for a train to leave a city in the east at say eight in the morning and arrive at a station in another prefecture in the west, say an hour later, but it was still eight in the morning. Trains not only helped industry spread throughout the nation of Japan, but also brought about the first standards in the way time was told.