Later clockmakers used the circular model of the sundial to base the layout of their new technology. Although the first mechanical clocks in Europe, built for medieval clock towers, were 24-hour devices, by the 14th century, mechanical clocks began to be built with 12-hour faces, perhaps to save space and the eyes of pocket watch carriers.
Eventually clockmakers just threw in the towel and embraced a.m. and p.m., even though these designations didn't have much to do with the astronomical bodies anymore. However, by the late 19th century, starting with the Canadian Pacific Railway in 1886, more countries and military entities started telling time based on the 24-hour clock. With the exception of countries like the U.S., Australia, Canada and the Philippines, where the 12-hour system is officially used, most other countries officially use a 24-hour clock, although ancient habits die hard: If you ask someone in Ireland, China or France the time, they're equally likely to use a.m. and p.m.