Tools.h++ Manual

104011 Tandem Computers Incorporated 21-233
21
RWZone
Synopsis
#include <time.h>
#include <rw/zone.h>
(abstract base class)
Description
RWZone
is an abstract base class. It defines an interface for time zone issues
such as whether or not daylight savings time is in use, the names and offsets
from UTC (also known as GMT) for both standard and daylight savings times,
and the start and stop dates for daylight savings 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
RWZone
should act.
Most programs interact with
RWZone
only by passing an
RWZone
reference to
an
RWTime
or
RWDate
member function that expects one.
RWZoneSimple
is an implementation of the abstract
RWZone
interface
sufficient to represent U.S.A. daylight savings time rules. Three instances of
RWZoneSimple
are initialized from the global environment at program startup
to represent local, standard, and universal time. They are available via calls to
the static member functions
RWZone::local(), RWZone::standard()
,
and
RWZone::utc()
, respectively. See the class
RWZoneSimple
for details.
Example
#include <rw/zone.h>
#include <rw/rwtime.h>
#include <rw/rstream.h>
main() {
RWTime now;
cout << now.asString(RWZone::local()) << endl;
cout << now.asString(RWZone::utc()) << endl;
return 0;
}