Why You Should Never Use Timezone Abbreviations Like EST or PST in Your Code

Developer
scheduling

EST, PST, CST, IST — these look like time zones. They’re not. They’re informal shorthand that maps inconsistently across libraries, languages, and countries. Using them in code is how you get scheduling bugs that appear in production twice a year at DST transition time.

Why abbreviations fail

They’re ambiguous. IST alone could be:

  • India Standard Time (UTC+5:30)
  • Ireland Standard Time (UTC+1)
  • Israel Standard Time (UTC+2)

CST could be US Central Standard Time (UTC−6), China Standard Time (UTC+8), Cuba Standard Time (UTC−5), or Australian Central Standard Time (UTC+9:30).

When your date library encounters CST, it picks one. Which one depends on the library, its version, and sometimes the system locale. You may not find out it picked wrong until a scheduling bug surfaces in production — at which point the bug has been silently present for a while.

They don’t encode DST. EST is UTC−5, but New York in summer is EDT (UTC−4). If you parse 2026-06-20 15:00 EST and treat it as UTC−5, you’re off by an hour. Some libraries silently correct this. Many don’t.

They have no standard. Unlike IANA zone names, abbreviations have no governing spec. Different systems interpret the same string differently.

What to use instead

IANA zone names are the correct way to identify a time zone in code:

Abbreviation (don’t use)IANA name (use this)
EST / EDTAmerica/New_York
PST / PDTAmerica/Los_Angeles
CST / CDTAmerica/Chicago
GMT / BSTEurope/London
CET / CESTEurope/Berlin (or the relevant city)
ISTAsia/Kolkata or Europe/Dublin or Asia/Jerusalem
JSTAsia/Tokyo

IANA names encode the full DST history. America/New_York knows that New York is UTC−5 in winter and UTC−4 in summer, and on exactly which dates those transitions happen.

In practice

JavaScript:

// Bad
new Date("2026-06-20 15:00 EST"); // ambiguous, library-dependent

// Good
const dt = new Temporal.ZonedDateTime(
  Temporal.PlainDateTime.from("2026-06-20T15:00"),
  "America/New_York",
);

Python:

# Bad
datetime.strptime('2026-06-20 15:00 EST', '%Y-%m-%d %H:%M %Z')  # unreliable

# Good
from zoneinfo import ZoneInfo
from datetime import datetime
dt = datetime(2026, 6, 20, 15, 0, tzinfo=ZoneInfo('America/New_York'))

PostgreSQL:

-- Bad: storing a bare timestamp
INSERT INTO events (start_time) VALUES ('2026-06-20 15:00:00');

-- Good: store UTC, keep the zone name in a separate column
INSERT INTO events (start_time_utc, user_timezone)
VALUES ('2026-06-20 19:00:00+00', 'America/New_York');

When abbreviations arrive from outside

You can’t always control what comes in. If you receive a time string with an abbreviation from user input or an external API, treat it as untrusted:

  1. Get the user’s IANA zone from the browser: Intl.DateTimeFormat().resolvedOptions().timeZone
  2. Map ambiguous abbreviations to IANA names with a lookup table — and flag genuinely ambiguous ones (like IST) rather than guessing
  3. Never silently assume the library resolved the abbreviation correctly

Enforce IANA names at input boundaries and you’ll avoid the entire class of DST-related scheduling bugs.

Buy me a coffe