Course contentsShow
← Web Development
Lesson 2747 of 2,98249. Dates, Times, and Numbers on the WebFree lesson

Understanding UTC and Timezone Offsets

Learn what UTC is, how timezone offsets work, and why UTC is the foundation for web time handling.

Understanding UTC and Timezone Offsets

You'll learn what UTC is, how timezone offsets work, and why they form the foundation of reliable web time handling.

What is UTC?

UTC (Coordinated Universal Time) is the world's time standard — a single, unchanging reference point for all time calculations. Think of it as the "anchor clock" that never shifts, while all other timezones are simply offsets from this anchor.

UTC replaced GMT (Greenwich Mean Time) as the modern standard and doesn't observe daylight saving time, making it predictable and consistent.

How Timezone Offsets Work

A timezone offset is the difference between UTC and a local timezone, expressed in hours and minutes:

  • New York (EST): UTC-5 (5 hours behind UTC)
  • London: UTC+0 (same as UTC)
  • Tokyo: UTC+9 (9 hours ahead of UTC)
  • India: UTC+5:30 (offsets can include minutes!)

When New York switches to EDT (daylight saving), its offset becomes UTC-4. The offset changes, but UTC never does.

Why UTC Matters for Web Development

When users interact with your web application from different timezones, storing times as UTC prevents confusion:

  1. User in Tokyo creates an event at "3:00 PM local" (UTC+9)
  2. Server stores it as "6:00 AM UTC"
  3. User in New York (UTC-5) sees it correctly as "1:00 AM local"

Without UTC as your baseline, you'd need to track every user's timezone offset and manually calculate conversions — error-prone and fragile.

Key Takeaway: UTC is the universal reference point for all web time handling; always store dates in UTC and convert to local timezones only for display, ensuring consistent time representation across different locations and daylight saving changes.