It was on November 18, 1883 that all U.S. railroads set their clocks to use the same standard time. Before then each railroad set their clocks to the time of the railroad's major city. There may have been a difference of over 20 minutes between these and getting connections was frustrating for passengers. Travelling in a train from New York might mean you would arrive at 1:55, but the 2 o'clock train from another part of the country might actually leave at 2:20 New York time. To avoid confusion with a.m. and p.m. a 24 hour clock was eventually adopted.
Time Zones before 1883 were not used and even within the same state there could be 2 minutes or more difference between towns.