Humans have understood how to calculate the length of a day pretty accurately for a long time. But there wasn’t a standard way to approach time on a global scale until the late 19th century, and happened because of railroads.
Research:

SYMHC Classics: Libertalia
32:21

Behind the Scenes Minis: Pirate Evolution
15:30

Thomas Henry Huxley
41:04