
Time Zone Conversion Is Not Just Adding or Subtracting Hours
"Just subtract 5 hours for Eastern Time." This advice works most of the time and fails catastrophically the rest. The "rest" includes Daylight Saving Time transitions, half-hour and quarter-hour offset zones, zones that change their UTC offset permanently, and the International Date Line. Time zones are a political construct, not a mathematical one. They change based on legislation, not physics. And that makes them the worst kind of engineering problem: one where the rules are ambiguous and mutable. The IANA time zone database The only reliable way to handle time zones is the IANA (Internet Assigned Numbers Authority) time zone database, also called the Olson database. It contains the complete history of time zone rules for every region, including all DST transitions, offset changes, and political redefinitions. A time zone is not a fixed offset. "Eastern Time" is not "UTC-5." It is "America/New_York," which is UTC-5 during standard time and UTC-4 during Daylight Saving Time. The trans
Continue reading on Dev.to Webdev
Opens in a new tab




