Cron Jobs Near Midnight Can Report on the Wrong Day Due to Time Zones
Cron schedules run in UTC by default, so a job meant for local midnight can fire on the wrong calendar day for users in other regions. The author has seen this same root cause across four codebases, where reporting windows end up shifted by hours. Edge cases such as month boundaries and daylight saving transitions can move records into the wrong month or cause a one-hour drift. The recommended fix is to define the business timezone as an IANA name like Europe/Berlin rather than a fixed UTC offset, compute the reporting window in that zone, and convert to UTC only at query time.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in