HydraExpress™ C++ API Reference Guide

 
Loading...
Searching...
No Matches
rwsf::DaylightRule Struct Reference

Represents a single Daylight Saving Time rule. More...

#include <rwsf/core/TimeZone.h>

Public Attributes

DaylightBoundary begin_
DaylightBoundary end_
short firstYear_
DaylightRule const * next_
char observed_

Detailed Description

DaylightRule is a structure that declares a single Daylight Saving Time (DST) rule in a DST ruleset. A full ruleset is a set of linked DaylightRule structures, moving backward in time from the most recent to the first year the daylight savings time was put into effect.

A single DaylightRule holds data (in the specified order) for:

  • A link to the next rule in the ruleset (each progressive rule should move backward in time).
  • The first year this rule took effect (should be more recent than the first year of the next rule).
  • Whether DST is enabled during this period (0 to completely disable DST, 1 to keep it on).
  • A DaylightBoundary specifying the minute in the year that DST is enabled.
  • A DaylightBoundary specifying the minute in the year that DST is disabled.

Here's an example of a daylight ruleset for U.S. DST rules (remember, the daylight boundaries use 0-based indices, so a month of 0 = January):

// Rule is defined as: { linkToNext , year, On?, { m, w, wd, min } start, { m, w, wd, min } stop };
DaylightRule usRuleAuld = { 0, 0000, 1, { 3, 4, 0, 120 }, { 9, 4, 0, 120 } };
DaylightRule usRule1967 = { &usRuleAuld, 1967, 1, { 3, 0, 0, 120 }, { 9, 4, 0, 120 } };
DaylightRule usRule1974 = { &usRule1967, 1974, 1, { 0, 0, 0, 120 }, { 9, 4, 0, 120 } };
DaylightRule usRule1975 = { &usRule1974, 1975, 1, { 1, 4, 0, 120 }, { 9, 4, 0, 120 } };
DaylightRule usRule1976 = { &usRule1975, 1976, 1, { 3, 4, 0, 120 }, { 9, 4, 0, 120 } };
DaylightRule usRule1987 = { &usRule1976, 1987, 1, { 3, 0, 0, 120 }, { 9, 4, 0, 120 } };
DaylightRule usRule2007 = { &usRule1987, 2007, 1, { 2, 1, 0, 120 }, {10, 0, 0, 120 } };
Represents a single Daylight Saving Time rule.
Definition TimeZone.h:121

So, use of the rule usRule2007 will result in a DST ruleset that captures all DST rules in U.S. history, using the correct rule for the year requested.

Member Data Documentation

◆ begin_

DaylightBoundary rwsf::DaylightRule::begin_

This structure indicates the time of year, to the minute, when DST begins during this period (See struct description for DaylightBoundary).

◆ end_

DaylightBoundary rwsf::DaylightRule::end_

This structure indicates the time of year, to the minute, when standard time resumes during this period (See struct description for DaylightBoundary).

◆ firstYear_

short rwsf::DaylightRule::firstYear_

Four-digit representation of the year in which this rule first goes into effect.

◆ next_

DaylightRule const* rwsf::DaylightRule::next_

Points to the next rule in a chain that continues backwards in time.

◆ observed_

char rwsf::DaylightRule::observed_

A boolean value used to specify a period of years for which Daylight Saving Time is not observed.

  • 1 - Daylight Saving Time is in effect during this period
  • 0 - Daylight Saving Time is not in effect during this period
Note
These are numeric values, not the ASCII characters '1' and '0'.)

Copyright © 2026 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.