HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Attributes
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:

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 } };

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

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).

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).

short rwsf::DaylightRule::firstYear_

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

DaylightRule const* rwsf::DaylightRule::next_

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

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 © 2020 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.