UTC (Coordinated Universal Time)
utc
The primary time standard by which the world regulates clocks and time, serving as the basis for civil timekeeping globally.
timezone
A time zone is a geographical region where the same standard time is used. The concept was introduced in the 19th century to replace the chaotic system of local solar times that made railway scheduling nearly impossible. Today, there are over 24 time zones, some offset by 30 or 45 minutes rather than full hours.
Time zones are generally defined as fixed offsets from UTC. However, political boundaries often override geographical logic, meaning a single country may choose to use one time zone despite spanning multiple meridians. The IANA Time Zone Database (tzdata) is the authoritative source used by operating systems and programming languages to handle time zone conversions.
Developers frequently encounter issues with time zones when storing and displaying timestamps. Best practice is to store all times in UTC and convert to local time only at the presentation layer. Daylight saving time transitions add further complexity, as they can cause ambiguous or skipped local times.
Was this article helpful?
Learn how time zones divide the world into regions with different local times, how UTC offsets work, and why some zones use half-hour increments.
Python 3.9 introduced zoneinfo as the standard library solution for IANA time zones, but the long-established pytz package remains in many codebases. This article compares the two, explains the naive vs aware boundary, and covers practical pitfalls including Windows tzdata, the fold attribute, and migration strategy.
The java.time API introduced in Java 8 offers five primary classes for representing dates and times. Knowing when to use Instant, OffsetDateTime, ZonedDateTime, LocalDateTime, or LocalDate is the key to avoiding time zone bugs. This article walks through each class with practical guidance for Spring Boot and JPA projects.