Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Hydra Core Library Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::TimeZone

Group:  General

Local Index

Members

Header File

#include <rwsf/core/TimeZone.h>

Description

rwsf::TimeZone is an abstract base class. It defines an interface for time zone issues such as whether or not Daylight Saving Time is in use, the names and offsets from GMT (also known as UTC) for both standard and Daylight Saving Times, and the start and stop dates for Daylight Saving Time, if used. Note that because it is an abstract base class, there is no way to actually enforce these goals -- the description here is merely the model of how a class derived from rwsf::TimeZone should act.

Most programs interact with rwsf::TimeZone only by passing an rwsf::TimeZone reference to an rwsf::DateTime member function that expects one.

Daylight saving-time rules are volatile, often reflecting geographical and political changes. In some cases, the hard-coded table-driven struct DaylightRule does not accurately reflect the locale installed on your machine. rwsf::TimeZone::os() creates a new rwsf::TimeZoneSimple containing the daylight rule discovered from the underlying operating system. The onus of correctness for this DST rule is on the operating system itself.

In many cases, you may want more explicit control of the DST rule for the intended rwsf::TimeZoneSimple. If so, you can build a DST rule with arbitrary begin and end times (see the DaylightRule below), and provide it as a parameter to rwsf::TimeZoneSimple.

Enumerations

enum DstRule {//supported Daylight Savings Time jurisdictions:
  NoDST,      // Daylight Savings Time never observed
  NoAm,       // North America (US, Canada)
  WeEu,       // Much of Western Europe, excluding the UK
  OfficialEU  // Official European Union DST rules.
};
enum StdZone {
  NewZealand = -12,    CarolineIslands,     MarianaIslands,
  Japan,               China,               Java,
  Kazakh,              Pakistan,                CaspianSea,
  Ukraine,             Nile,                Europe,
  Greenwich,           Azores,              Oscar,
  Greenland,           Atlantic,            USEastern,
  USCentral,           USMountain,          USPacific,
  Yukon,               Hawaii,              Bering
};

Public Member Functions

virtual long
timeZoneOffset() const = 0;
virtual long
altZoneOffset() const = 0; 
virtual bool
daylightObserved() const = 0; 
virtual bool
isDaylight(const struct tm* tspec) const = 0; 
virtual void
getBeginDaylight(struct tm*) const = 0; 
virtual void
getEndDaylight  (struct tm*) const = 0; 
virtual std::string
timeZoneName() const = 0; 
virtual std::string
altZoneName() const = 0; 

Static Public Member Functions

static const TimeZone&
local();
static const TimeZone&
os();
static const TimeZone&
standard();
static const TimeZone&
utc();
static const TimeZone*
local(const TimeZone*);
static const TimeZone*
standard(const TimeZone*);
static const DaylightRule*
dstRule(DstRule rule = NoAm); 


Previous fileTop of DocumentContentsIndex pageNext file

©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks and HydraSDO is a trademark of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.