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:
“INTERNATIONAL CONFERENCE HELD AT WASHINGTON FOR THE PURPOSE OF FIXING A PRIME MERIDIAN AND A UNIVERSAL DAY.” (Protocols of the Proceedings.” October 1884. https://www.gutenberg.org/files/17759/17759-h/17759-h.htm
Fleming, Sandford. “Terrestrial time: a memoir.” 1876. Digitized: https://archive.org/details/cihm_06112/page/n17/mode/2up
Fleming, Sandford. “Papers on time-reckoning and the selection of a prime meridian to be common to all nations.” 1879. Digitized: https://archive.org/details/cihm_03135/page/n17/mode/2up
Creet, Mario. “FLEMING , Sir SANDFORD.” Dictionary of Canadian Biography. http://www.biographi.ca/en/bio.php?id_nbr=7370
Creet, Mario. “Sandford Fleming and Universal Time.” Scientia Canadensis. Volume 14, numéro 1-2 (38-39). https://www.erudit.org/fr/revues/scientia/1990-v14-n1-2-scientia3118/800302ar.pdf
Shepardson, David. “U.S. Senate approves bill to make daylight saving time permanent.” Reuters. March 16, 2022. https://www.reuters.com/world/us/us-senate-approves-bill-that-would-make-daylight-savings-time-permanent-2023-2022-03-15/
“What Shall Be the Prime Meridian for the World?” International institute for preserving and perfecting weights and measures. Committee on standard time. Cleveland, O., 1884. https://babel.hathitrust.org/cgi/pt?id=mdp.39015019895203&view=1up&seq=8
Biggerstaff, Valerie. “Opinion: When Georgia had two time zones.” Appen Media. April 14, 2021. https://www.appenmedia.com/opinion/opinion-when-georgia-had-two-time-zones/article_0bb3e6c4-9c84-11eb-a1f5-6b1a42a8e61a.html
Lange, Katie. “Daylight Saving Time Once Known As 'War Time.'” U.S. Department of Defense. March 8, 2019. https://www.defense.gov/News/Feature-Stories/story/Article/1779177/daylight-saving-time-once-known-as-war-time/
“DID BEN FRANKLIN INVENT DAYLIGHT SAVING TIME?” The Franklin Institute. https://www.fi.edu/benjamin-franklin/daylight-savings-time
“United States Congressional Serial Set.” U.S. Government Printing Office. Volume 2296. 1885. Accessed online: https://play.google.com/store/books/details?id=_1JHAQAAIAAJ&rdid=book-_1JHAQAAIAAJ&rdot=1
Rosenberg, Matt. "The History and Use of Time Zones." ThoughtCo, Aug. 27, 2020, thoughtco.com/what-are-time-zones-1435358.
“The New Railroad Time.” New York Times. Oct. 12, 1883. https://timesmachine.nytimes.com/timesmachine/1883/10/12/106260579.pdf?pdf_redirect=true&ip=0
Glass, Andrew. “President Wilson signs Standard Time Act, March 19, 1918.” Politico. March 19, 2018. https://www.politico.com/story/2018/03/19/wilson-signs-standard-time-act-march-19-1918-467550
Britannica, The Editors of Encyclopaedia. "Sir Sandford Fleming". Encyclopedia Britannica, 3 Jan. 2022, https://www.britannica.com/biography/Sandford-Fleming
“History of Time Zones.” Bureau of Transportation Statistics. Feb. 21, 2021. https://www.bts.gov/geospatial/time-zones
Gordon, Nicholas. “The Senate wants to make daylight saving time permanent—but that could leave Americans with less sleep and worse health.” Fortune. March 16, 2022. https://fortune.com/2022/03/16/daylight-saving-time-sleep-senate-protecting-sunshine-act/
“Public Law 89-387 – An ACT To promote the observance of a uniform system of time throughout the United States.” April 13, 1966. https://www.govinfo.gov/content/pkg/STATUTE-80/pdf/STATUTE-80-Pg107.pdf