time_zone
|
 |
Represents a logical time zone
with an optional daylight savings time adjustment. In the event of specifying
a local time, if that time falls within the range of duplicate times caused
by DST adjustments, then that time will be interpreted as having occurred
after the DST adjustment.
Declaration
#include <ospace/time/timezone.h>
class os_time_zone
Interface
Constructor
os_time_zone(
const os_time_period& offset )
Constructs a time zone
with offset offset .
Constructor
os_time_zone(
const os_time_period& offset ,
const string& name ,
const string& dst_name )
Constructs a time zone
with offset offset , standard time name,
and daylight savings time (dst) dst_name .
Constructor
os_time_zone(
const os_time_period& offset ,
const string& name )
Constructs a time zone with offset offset
and standard time name .
Destructor
~os_time_zone()
Destroys time zone.
aleutian
/*
static */ const os_time_zone& aleutian()
Returns the Aleutian (ast/adt)
time zone.
arizona
/* static */
const os_time_zone& arizona()
Returns the Mountain (mst/-) time zone.
atlantic
/*
static */ const os_time_zone& atlantic()
Returns the Atlantic (ast/adt)
time zone.
central
/*
static */ const os_time_zone& central()
Returns the Central (cst/cdt)
time zone.
central_european
/*
static */ const os_time_zone& central_european()
Returns the Central
European (cet/cetdst) time zone.
dst_adjustment
os_time_period
dst_adjustment( const os_time& time ,
const os_date& date ,
bool std_time )
const
Returns the dst
adjustment value for time and date
, where std_time is true
if representation is standard and false if
representation is local.
dst_name
string
dst_name() const
Returns the daylight
savings name.
dst_observed
bool
dst_observed() const
Returns true
if the time zone observes daylight savings time.
eastern
/*
static */ const os_time_zone& eastern()
Returns the Eastern (est/edt)
time zone.
greenwich
/*
static */ const os_time_zone& greenwich()
Returns the Greenwich (gmt/bst)
time zone.
hawaii
/* static */
const os_time_zone& hawaii()
Returns the Hawaiin (hst/-) time zone.
indiana
/* static */
const os_time_zone& indiana()
Returns the Eastern (est/-) time zone.
insert
bool
insert( os_time_zone_rule& rule )
Inserts a daylight
savings time rule for this time zone.
is_dst
bool
is_dst( const os_time& time ,
const os_date& date ,
bool std_time )
const
Returns true
if time and date have
daylight savings time, where std_time is true
if representation is standard and false if
representation is local.
israel
/* static */
const os_time_zone& utc()
Returns the Israeli (ist/idt) time zone.
mountain
/*
static */ const os_time_zone& mountain()
Returns the Mountain (mst/mdt)
time zone.
name
string
name() const
Returns the time zone
standard name.
name
string
name( const os_time& time ,
const os_date& date ,
bool std_time )
const
Returns the name of the
time zone associated with time and date
, where std_time is true
if representation is standard and false if
representation is local.
newfoundland
/*
static */ const os_time_zone& newfoundland()
Returns the Newfoundland
(nst/ndt) time zone.
offset
os_time_period
offset( const os_time& time ,
const os_date& date ,
bool std_time )
const
Returns the offset for time
and date , where std_time
is true if representation is standard and false
if representation is local.
offset
os_time_period
offset() const
Returns the time period
offset.
pacific
/*
static */ const os_time_zone& pacific()
Returns the Pacific (pst/pdt)
time zone.
portuguese
/*
static */ const os_time_zone& portuguese()
Returns the Portuguese (pwt/pst)
time zone.
print
void
print( ostream& stream )
const
Prints to stream
.
south_africa
/*
static */ const os_time_zone& south_africa()
Returns the South African
(sas/sadt) time zone.
utc
/* static */
const os_time_zone& utc()
Returns the Coordinated Universal Time (utc/-) time
zone, which observes no daylight savings time and is the basis for which all
other time zones are relative to.
western_european
/*
static */ const os_time_zone& western_european()
Returns the Western
European (wet/wetdst) time zone.
yukon
/*
static */ const os_time_zone& yukon()
Returns the Yukon (yst/ydt)
time zone.
Non-Member Functions
<<
ostream&
operator<<( ostream& stream ,
const os_time_zone& time_zone )
Prints time_zone
to stream .
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved - For use by licensed users only.