Until the railroads came to prairie towns after the Civil War, each town set its clock using the sun. It was impossible to run railroads under such circumstances, and so railroads developed "standard time zones," for the United States. They became the standard well before they were codified into law.