Back to Blog
Software

Servers Run on UTC, Business Runs on KST: Date and Time Zone Design for Enterprise Systems and Preventing the 9-Hour Shift Bug

Cloud servers run on UTC while Korean businesses run on KST. This post explains why the nine-hour shift bug happens and sets out time zone design rules, from separating instants and dates to aggregation, cron schedules and testing.

POLYGLOTSOFT Tech Team2026-11-097 min read8
Time ZoneUTCDate HandlingCloudEnterprise System

We Moved to the Cloud and Every Deadline Shifted by a Day

After migrating a business system from on-premises to the cloud, one complaint shows up more than any other: "the dates are off by one." In-house servers in Korea are usually set to Korea Standard Time (KST, UTC+9), but cloud servers and containers on platforms like AWS and Vercel default to UTC. The same code, in a different runtime, produces results that are nine hours off.

Typical symptoms:

  • Records near midnight land on the wrong day: An order placed between 00:00 and 08:59 KST is still the previous day in UTC. Cut dates by the server's time zone and nine hours of early-morning data get booked as yesterday's revenue, every day
  • Deadlines move a day earlier: Store a November 30 deadline as `2026-11-30T00:00+09:00` and it becomes 15:00 UTC on November 29. Extract the date on a UTC server and you get the 29th
  • Batch schedules run at the wrong time: A cron entry someone wrote meaning "7 a.m." actually runs at 4 p.m. KST (07:00 UTC)
  • These bugs surface late because developer machines run on KST. Every test passes locally and on the internal staging server, and the problem only appears in production, usually when month-end figures fail to reconcile.

    An Instant and a Date Are Different Kinds of Data

    Start by separating two kinds of values:

  • Instants (timestamps): a single moment, identical everywhere on Earth. Order time, login time and approval time all belong here
  • Calendar dates: "that day," independent of any time zone. Birthdays, contract deadlines, business days and leave days belong here
  • Databases and languages draw this line with types. PostgreSQL's `timestamptz` stores UTC and converts to the session time zone on display, while `timestamp` (without time zone) and `date` carry no zone at all. Java separates `Instant`/`ZonedDateTime` from `LocalDate`; Python separates aware and naive `datetime` from `date`. JavaScript's `Date`, by contrast, is always an instant, so using it to hold a plain date is risky.

    The most common trap is storing a date-only value as a midnight timestamp. A November 30 deadline belongs in a `date` column or as the string `"2026-11-30"`, so that it reads as the 30th on any server.

    Rules for Storage, Processing and Display

  • Storage: Store instants in UTC or with an explicit offset (`timestamptz`, ISO 8601 with `+09:00`); store dates as dates
  • Display: Convert to the user's time zone only at the presentation layer
  • Name the business time zone in code: Keep `Asia/Seoul` as a configuration constant and pass it explicitly into date calculations. In server code, avoid APIs that follow the runtime's zone, such as `new Date(y, m, d)` or `getDate()`
  • Define how external API dates are interpreted: Public APIs often return compact strings like `20261109143000` with no zone information. Decide the rule ("interpret as KST") and convert explicitly, for example with `Date.UTC(y, m - 1, d, h - 9, min)`
  • Aggregation and Batch Jobs

    Compute "today" and "this month" in the business time zone. November in KST runs from `2026-10-31T15:00Z` (inclusive) to `2026-11-30T15:00Z` (exclusive). In SQL, convert first and truncate second, as in `date_trunc('month', created_at AT TIME ZONE 'Asia/Seoul')`.

    Check which zone your cron expressions use. Most cloud schedulers interpret cron in UTC, so a 07:00 KST job is written `0 22 * * *` (22:00 UTC the previous day). Put the intended KST time in a comment next to the entry, and after deployment confirm the actual run time from execution records.

    With overseas users or subsidiaries, write the policy down. Decide up front whether settlement follows headquarters' KST or each entity's local zone. Korea has no daylight saving time, but U.S. and European offices change offsets twice a year, so use IANA zone names (`America/New_York`) rather than fixed offsets like `-05:00`.

    Catching It with Tests

  • Run tests under different runtime zones: Running CI once with `TZ=UTC` and once with `TZ=Asia/Seoul` exposes environment-dependent code immediately
  • Boundary cases: Keep fixed cases for 23:59 vs. 00:00 KST, 08:59 vs. 09:00 KST (when the UTC date flips), month-end, year-end and February 29 in leap years
  • Consistent log timestamps: Log in UTC ISO 8601 with `Z`, or append `+09:00` if you log in KST. Logs without an offset lead engineers to misread times by nine hours during incident analysis
  • The POLYGLOTSOFT Approach

    In cloud migrations and subscription-based development projects, POLYGLOTSOFT treats the time zone policy as an early design deliverable. We classify every field as an instant or a date, fix the business time zone, define how dates from external integrations are interpreted and agree on the cron notation during requirements, and we include cross-time-zone tests in CI by default. If your figures stopped reconciling after a cloud move, or you want a review of date handling in a new system, contact POLYGLOTSOFT. We will assess your current design and map out what needs fixing before you migrate.