Time in programming is built on two concepts: durations and instants measured relative to a reference epoch.
Civil time uses calendar systems (like the Gregorian calendar) to label instants as date-times, introducing ambiguous periods (months, days) and requiring leap years.
UTC defines the SI second via atomic clocks and inserts leap seconds irregularly to stay aligned with Earth’s rotation, complicating precise duration calculations.
Timezones map UTC instants to local civil times via UTC offsets that can change unpredictably (DST, political decisions), creating skipped or repeated local times.
The IANA Timezone Database tracks historical, current, and projected timezone rule changes (since 1970) to enable accurate conversions between UTC and local times.
Applications should record precise instants in UTC and use IANA data or appropriate libraries to convert to local times, while respecting user intent for scheduled events even if timezone rules change.
Get notified when new stories are published for "General AI News"