When a government changes its daylight-saving rules, nothing happens to the sky, the sun or the planet. Something happens to a text file. The file is part of the IANA time-zone database, known as tzdb, and it is the reason your phone knows what to do on the last Sunday in March.
One database, maintained by hand
The database began in the 1980s, when a programmer named Arthur David Olson assembled a machine-readable list of the world's offsets and transition rules so that Unix systems could display local time correctly. It grew into a shared reference and is now maintained by a community of contributors, with releases distributed through the IANA time-zone project; Paul Eggert has been its long-standing coordinator. Its coverage is most systematic from 1970 onwards, with older history included where it is known — useful, but not a complete record for every place at every period.
The work is mostly waiting for governments. A country decides to abolish daylight saving, or to move its standard offset, or to change the date of a transition, and a patch arrives on the project's mailing list. The change is discussed, tested, released, and then propagated: Linux distributions, the Java runtime, browsers, phone operating systems and countless applications pick it up in their own time. There can be a delay between a government’s announcement and correct rules reaching a particular device, and during that gap some devices are right and others are wrong. How long the gap lasts depends on when the database is updated and how quickly each system distributes it.
Recent examples
Recent years have provided plenty of examples. Morocco suspends daylight saving during Ramadan, which means its offset changes several times in some years. Iran abolished daylight saving in 2022. Mexico did the same for most of the country, keeping it only along the northern border. Chile and Paraguay have shifted their transition dates. Each of these produces a patch, a release and a wave of updates.
Most people never see any of it. The database arrives inside the operating system, and a browser formats a date using whichever time-zone rules its environment supplies — the operating system, a bundled library such as ICU, or another runtime component, depending on the browser. When the rules change, the fix travels through the same channels as a security update, quietly, usually without a reboot.
A convention, not a science
What the database reveals is that international timekeeping is not a scientific system with a political layer on top. It is a political system that has been made machine-readable by a small group of people who care about edge cases. The next time a clock changes correctly in a country you have never visited, it is because someone updated a file.