How daylight savings time affects scheduled triggers

Triggers running on a scheduled frequency automatically switch between standard time (ST) and daylight savings time (DST) according to the trigger's time zone. However, you should consider how the switch between ST and DST can affect your triggers. Depending on your time zone and a trigger's scheduled run time, a time change could affect when your triggers run, or if they run at all.

Examples

A poorly scheduled overnight trigger

You create a trigger and set it to run at 2:00 AM Mountain Time (UTC -6:00) each night.

One day in the spring, you come into work to discover that the trigger did not run. The trigger failed because after 1:59, clocks skipped 2:00 and jumped ahead to 3:00, so its scheduled time never came. Then, one day in the fall, you come into work to discover that the trigger ran twice. This happened because after 2:59, clocks reverted to 2:00 and the trigger ran again.

Poorly scheduled triggers with dependencies

Imagine you are part of a small company with a few offices in North America. Without a dedicated fraud team, you identify accounts payable fraud with triggers that react to suspicious patterns in your data. These triggers run each night, based on new data from the previous day.

  • Duplicate Payments looks for suspected duplicate payments over $1000 and assigns these records a priority of High. This trigger runs at 2:00 AM Mountain Time.
  • Notify Controller looks for any records that have a priority of High and notifies your company's Controller. This trigger depends on the results of triggers like Duplicate Payments, so it runs at 1:30 AM Pacific Time (thirty minutes later).

One day in the fall, you come into work to discover that there are High-priority duplicate payments, but the Controller was not notified. This happened because after 1:59 AM, Mountain Time reverted to 1:00 AM, and was briefly the same time as Pacific Time. As a result, Notify Controller ran before Duplicate Payments.

Tips to ensure your triggers run as expected

  • Know which hour daylight savings time starts and ends in your trigger's timezone(s). Different parts of the world switch over at different times and with different levels of coordination.
  • Avoid scheduling triggers during hours that are affected by time changes.
  • If triggers depend on the results of other triggers:
    • Consider choosing a single time zone for all those triggers so dependencies are not broken by time changes; or
    • Leave enough time between dependent triggers so, even with time changes, the execution order is not broken.