For as long as people have been keeping track of time, clocks have been set according to the movement of the sun. As late as the 1880s, local time in most U.S. towns revolved around "high noon" -- the time when the sun appeared highest in the sky. As you can imagine, all these different local times posed a scheduling nightmare for railroads, who often were stuck posting dozens of arrival and departure times for the same train, each correspondent to a different town or local time. To make matters worse, individual train stations set their own clocks, confusing passengers and making it impossible to coordinate accurate train schedules.
Rail systems found they were unable to run smoothly without a uniform time-keeping system -- and rather than turning to the governments of the United States or Canada, they took it upon themselves to create the new time-code system, dividing the continent into quadrants very similar to those we use today.
The popularity of the railroad made for an easy transition to the new time zones, as most people began adopting theirs immediately. Thirty-five years later Congress officially recognized the time zones set forth by the railroads and called on the Interstate Commerce Commission to supervise them.