Skip to content
Wade Womersley

wade.one

wade womersley – york based software engineer

  • Home
  • 2026
  • October
  • 22
  • A Scheduled Job Needs a Time Zone, Not Just an Hour

A Scheduled Job Needs a Time Zone, Not Just an Hour

Posted on October 22, 2026 By
Programming

“Run it at six” is incomplete information for a scheduled job. Six where, and should it stay at six when the clocks change? If the requirement is a local wall-clock time, storing a fixed UTC offset can quietly move the job by an hour for part of the year.

I would record the intended time zone alongside the schedule, then calculate the corresponding UTC instant for each occurrence. PHP’s DateTimeImmutable supports working with time-zone-aware date objects without changing the original object in place. The important part is preserving the meaning of the schedule, rather than just getting a plausible timestamp into a field.

The awkward cases deserve an explicit decision: a local time that occurs twice when the clocks go back, or does not occur when they go forward. For a recurring task, adding a fixed number of seconds to yesterday’s execution is not always equivalent to the next local calendar occurrence. Test the dates around a clock change, not only a random Tuesday in the middle of summer.

Time-zone bugs are annoying because the code can be internally consistent and still violate what somebody asked for. A schedule should be readable as a human promise, with a precise instant behind each run. If that promise is “18:00 in London”, keep London in the data.

Share:

  • Share on Facebook (Opens in new window) Facebook
  • Share on X (Opens in new window) X
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Reddit (Opens in new window) Reddit

Related

Comments

comments

Tags: php scheduling time-zones

Post navigation

❮ Previous Post: Hashed Asset Names Make CDN Releases Easier to Reason About

You may also like

Programming
Another day, another group of PHP “funness”
September 2, 2009
PHP
PHP 8.6 Partial Function Application Might Actually Make Callbacks Nicer
August 18, 2026
Programming
MCP Going Stateless Is the Boring Fix It Needed
August 15, 2026
Programming
Why Most Software Projects Do Not Need a Rewrite
March 26, 2026
  • AI
  • artificial intelligence
  • Ego-centric
  • Events
  • Films
  • Food
  • Gaming
  • Gym
  • Hardware
  • Holidays
  • News
  • PHP
  • Programming
  • Random Stuff
  • Reviews
  • Science
  • SEO
  • Software
  • Software Engineer
  • Support
  • Uncategorized
  • Work

Copyright © 2026 wade.one.

Theme: Oceanly News Dark by ScriptsTown