Skip to main content

Daylight Saving Time

Daylight Saving Time

$HOROLOG adjusts for seasonal time variants based on the algorithm supplied by the underlying operating system. After applying the $ZTIMEZONE value, InterSystems IRIS uses the operating system local time to adjust $HOROLOG (if needed) for seasonal time variants, such as Daylight Saving Time.

You can determine if Daylight Saving Time is in effect for the current date, or for a specified date and time using the IsDST()Opens in a new tab method. The following example returns the Daylight Saving Time (DST) status for the current date and time. Because this status could change while the program is running, this example checks it twice:

CheckDST
  SET x=$SYSTEM.Util.IsDST()
  SET local=$ZDATETIME($HOROLOG)
  SET x2=$SYSTEM.Util.IsDST()
  GOTO:x'=x2 CheckDST
  IF x=1 {WRITE local," DST in effect"}
  ELSEIF x=0 {WRITE local," DST not in effect"}
  ELSE {WRITE local," DST setting cannot be determined"}

The application of seasonal time variants may differ based on (at least) three considerations:

  • Operating system: Within a time zone, $HOROLOG for a given date may differ on different computers. This is because different operating systems use different algorithms to apply time variants. Because policies governing the beginning and end dates for Daylight Saving Time (and other time variants) have changed, older operating systems may not reflect current practice, and/or calculations using older $HOROLOG values may be adjusted using the current beginning and end dates, rather than the ones in force at that time.

  • Government policies have changed over time: There have been numerous changes to seasonal time variants since their first adoption in 1916 (much of Europe) and 1918 (United States). Daylight Saving Time has been adopted, rejected, and re-adopted by governmental policies in many places. The seasonal start and end dates for Daylight Saving Time have also changed numerous times. In the United States, recent changes of national policy have occurred in 1966, 1974–75, 1987, and 2007. Adoption of, or exemption from, national policies have also occurred due to local legislative actions. For example, the state of Arizona does not observe Daylight Saving Time.

  • Geography: Daylight Saving Time is summer time; the local clock shifts forwards (“Spring ahead”) at the start of DST and shifts backwards (“Fall back”) at the end of DST. Thus the calendar start and end dates for Daylight Saving Time within the same time zone are commonly reversed in the northern hemisphere and the southern hemisphere. Equatorial nations and most of Asia and Africa do not observe Daylight Saving Time.

FeedbackOpens in a new tab