Method Deck / timezones

Meeting time across three fixed offsets

Converts a single UTC date and time into local wall-clock times at three fixed UTC offsets, noting any date shift.

Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.

Try it

Inputs

Outputs

Steps

  1. Parse utc_date and utc_time into a day-number (Hinnant days_from_civil, cited above) and seconds-since-midnight, forming a single UTC instant in total seconds.
  2. Parse each of offset_a, offset_b, offset_c as a signed HH:MM offset from UTC, in seconds.
  3. For each offset: local_total_seconds = utc_total_seconds + offset_seconds; local_day_number = floor(local_total_seconds / 86400); seconds_into_day = local_total_seconds - local_day_number * 86400.
  4. Convert local_day_number back to a civil date and seconds_into_day back to HH:MM:SS.
  5. Compare local_day_number to the original UTC day-number to report same day, next day, or previous day.

Constants

None.

Sources

Worked example and test vectors

NameInputsAnswer
worked example{"utc_date":"2026-09-30","utc_time":"18:30:00","offset_a":"-05:00","offset_b":"+01:00","offset_c":"+09:00"}-05:00: 2026-09-30 13:30:00 (same day); +01:00: 2026-09-30 19:30:00 (same day); +09:00: 2026-10-01 03:30:00 (next day)
test vector: all same day{"utc_date":"2026-01-01","utc_time":"12:00:00","offset_a":"+00:00","offset_b":"+02:00","offset_c":"-03:00"}+00:00: 2026-01-01 12:00:00 (same day); +02:00: 2026-01-01 14:00:00 (same day); -03:00: 2026-01-01 09:00:00 (same day)
test vector: previous day rollover{"utc_date":"2026-06-15","utc_time":"01:00:00","offset_a":"-08:00","offset_b":"+00:00","offset_c":"+05:30"}-08:00: 2026-06-14 17:00:00 (previous day); +00:00: 2026-06-15 01:00:00 (same day); +05:30: 2026-06-15 06:30:00 (same day)

Published card