Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::local_time::posix_time_zone_base< CharT > Class Template Referenceabstract

A time zone class constructed from a POSIX time zone string. More...

#include <posix_time_zone.hpp>

Inheritance diagram for boost::local_time::posix_time_zone_base< CharT >:
Collaboration diagram for boost::local_time::posix_time_zone_base< CharT >:

Public Types

typedef
boost::posix_time::time_duration 
time_duration_type
 
typedef
date_time::time_zone_names_base
< CharT > 
time_zone_names
 
typedef
date_time::time_zone_base
< posix_time::ptime, CharT > 
base_type
 
typedef base_type::string_type string_type
 
typedef CharT char_type
 
typedef
base_type::stringstream_type 
stringstream_type
 
typedef boost::char_separator
< char_type, std::char_traits
< char_type > > 
char_separator_type
 
typedef boost::tokenizer
< char_separator_type,
typename
string_type::const_iterator,
string_type
tokenizer_type
 
typedef tokenizer_type::iterator tokenizer_iterator_type
 
typedef
posix_time::ptime::date_type::year_type 
year_type
 

Public Member Functions

 posix_time_zone_base (const string_type &s)
 Construct from a POSIX time zone string. More...
 
virtual ~posix_time_zone_base ()
 
virtual string_type std_zone_abbrev () const
 String for the zone when not in daylight savings (eg: EST) More...
 
virtual string_type dst_zone_abbrev () const
 String for the timezone when in daylight savings (eg: EDT) More...
 
virtual string_type std_zone_name () const
 String for the zone when not in daylight savings (eg: Eastern Standard Time) More...
 
virtual string_type dst_zone_name () const
 String for the timezone when in daylight savings (eg: Eastern Daylight Time) More...
 
virtual bool has_dst () const
 True if zone uses daylight savings adjustments otherwise false. More...
 
virtual posix_time::ptime dst_local_start_time (gregorian::greg_year y) const
 Local time that DST starts – NADT if has_dst is false. More...
 
virtual posix_time::ptime dst_local_end_time (gregorian::greg_year y) const
 Local time that DST ends – NADT if has_dst is false. More...
 
virtual time_duration_type base_utc_offset () const
 Base offset from UTC for zone (eg: -07:30:00) More...
 
virtual time_duration_type dst_offset () const
 Adjustment forward or back made while DST is in effect. More...
 
virtual string_type to_posix_string () const
 Returns a POSIX time_zone string for this object. More...
 
virtual posix_time::ptime dst_local_start_time (year_type y) const =0
 Local time that DST starts – undefined if has_dst is false. More...
 
virtual posix_time::ptime dst_local_end_time (year_type y) const =0
 Local time that DST ends – undefined if has_dst is false. More...
 

Detailed Description

template<class CharT>
class boost::local_time::posix_time_zone_base< CharT >

A time zone class constructed from a POSIX time zone string.

A POSIX time zone string takes the form of:
"std offset dst [offset],start[/time],end[/time]" (w/no spaces) 'std' specifies the abbrev of the time zone.
'offset' is the offset from UTC.
'dst' specifies the abbrev of the time zone during daylight savings time.
The second offset is how many hours changed during DST. Default=1
'start' and'end' are the dates when DST goes into (and out of) effect.
'offset' takes the form of: [+|-]hh[:mm[:ss]] {h=0-23, m/s=0-59}
'time' and 'offset' take the same form. Time defaults=02:00:00
'start' and 'end' can be one of three forms:
Mm.w.d {month=1-12, week=1-5 (5 is always last), day=0-6}
Jn {n=1-365 Feb29 is never counted}
n {n=0-365 Feb29 is counted in leap years}
Example "PST-5PDT01:00:00,M4.1.0/02:00:00,M10.1.0/02:00:00"
Exceptions will be thrown under these conditions:
An invalid date spec (see date class)
A boost::local_time::bad_offset exception will be thrown for:
A DST start or end offset that is negative or more than 24 hours
A UTC zone that is greater than +14 or less than -12 hours
A boost::local_time::bad_adjustment exception will be thrown for:
A DST adjustment that is 24 hours or more (positive or negative)

Note that UTC zone offsets can be greater than +12: http://www.worldtimezone.com/utc/utc+1200.html

Member Typedef Documentation

template<class CharT >
typedef boost::char_separator<char_type, std::char_traits<char_type> > boost::local_time::posix_time_zone_base< CharT >::char_separator_type
template<class CharT >
typedef CharT boost::local_time::posix_time_zone_base< CharT >::char_type
template<class CharT >
typedef boost::tokenizer<char_separator_type, typename string_type::const_iterator, string_type> boost::local_time::posix_time_zone_base< CharT >::tokenizer_type
typedef posix_time::ptime ::date_type::year_type boost::date_time::time_zone_base< posix_time::ptime , CharT >::year_type
inherited

Constructor & Destructor Documentation

template<class CharT >
virtual boost::local_time::posix_time_zone_base< CharT >::~posix_time_zone_base ( )
inlinevirtual

Member Function Documentation

template<class CharT >
virtual time_duration_type boost::local_time::posix_time_zone_base< CharT >::base_utc_offset ( ) const
inlinevirtual
virtual posix_time::ptime boost::date_time::time_zone_base< posix_time::ptime , CharT >::dst_local_end_time ( year_type  y) const
pure virtualinherited

Local time that DST ends – undefined if has_dst is false.

template<class CharT >
virtual posix_time::ptime boost::local_time::posix_time_zone_base< CharT >::dst_local_end_time ( gregorian::greg_year  y) const
inlinevirtual

Local time that DST ends – NADT if has_dst is false.

References boost::date_time::dst_adjustment_offsets< time_duration_type >::dst_end_offset_, and boost::date_time::not_a_date_time.

virtual posix_time::ptime boost::date_time::time_zone_base< posix_time::ptime , CharT >::dst_local_start_time ( year_type  y) const
pure virtualinherited

Local time that DST starts – undefined if has_dst is false.

template<class CharT >
virtual posix_time::ptime boost::local_time::posix_time_zone_base< CharT >::dst_local_start_time ( gregorian::greg_year  y) const
inlinevirtual

Local time that DST starts – NADT if has_dst is false.

References boost::date_time::dst_adjustment_offsets< time_duration_type >::dst_start_offset_, and boost::date_time::not_a_date_time.

template<class CharT >
virtual time_duration_type boost::local_time::posix_time_zone_base< CharT >::dst_offset ( ) const
inlinevirtual
template<class CharT >
virtual string_type boost::local_time::posix_time_zone_base< CharT >::dst_zone_abbrev ( ) const
inlinevirtual

String for the timezone when in daylight savings (eg: EDT)

For those time zones that have no DST, an empty string is used

Implements boost::date_time::time_zone_base< posix_time::ptime, CharT >.

References boost::date_time::time_zone_names_base< CharT >::dst_zone_abbrev().

Referenced by boost::local_time::posix_time_zone_base< CharT >::to_posix_string().

template<class CharT >
virtual string_type boost::local_time::posix_time_zone_base< CharT >::dst_zone_name ( ) const
inlinevirtual

String for the timezone when in daylight savings (eg: Eastern Daylight Time)

The full DST name is not extracted from the posix time zone string. Therefore, the STD abbreviation is used in it's place. For time zones that have no DST, an empty string is used

Implements boost::date_time::time_zone_base< posix_time::ptime, CharT >.

References boost::date_time::time_zone_names_base< CharT >::dst_zone_name().

template<class CharT >
virtual bool boost::local_time::posix_time_zone_base< CharT >::has_dst ( ) const
inlinevirtual

True if zone uses daylight savings adjustments otherwise false.

Implements boost::date_time::time_zone_base< posix_time::ptime, CharT >.

template<class CharT >
virtual string_type boost::local_time::posix_time_zone_base< CharT >::std_zone_abbrev ( ) const
inlinevirtual
template<class CharT >
virtual string_type boost::local_time::posix_time_zone_base< CharT >::std_zone_name ( ) const
inlinevirtual

String for the zone when not in daylight savings (eg: Eastern Standard Time)

The full STD name is not extracted from the posix time zone string. Therefore, the STD abbreviation is used in it's place

Implements boost::date_time::time_zone_base< posix_time::ptime, CharT >.

References boost::date_time::time_zone_names_base< CharT >::std_zone_name().


The documentation for this class was generated from the following file: