All problems

Shipment Cutoff Check Ignores Timezone Offsets

Level 2 · node · Correctness · Timezone-aware timestamp comparison error

Scenario

A logistics service decides whether an order was received by a warehouse’s same-day shipping cutoff. The API receives ISO 8601 timestamps with offsets, and different offsets can represent the same instant. The current scheduler removes the timezone offset and compares only the local date-time strings, causing some orders to be incorrectly deferred to the next business day.

Requirements

- Compare order and cutoff times by their actual instants - Treat equal instants as within the cutoff even when timezone offsets differ - Orders later than the cutoff must be deferred to the next business day - Preserve normal before/after behavior when both values use the same offset - Support valid ISO 8601 inputs containing offsets

Acceptance criteria

  • An order at the same instant as the cutoff is eligible for same-day shipping
  • An order before the cutoff expressed with another offset is accepted correctly
  • An order after the cutoff is excluded from same-day shipping
  • An earlier order using the same offset remains accepted
  • UTC Z notation and offset notation are compared by instant