Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::date_time::us_dst_trait< date_type > Struct Template Reference

Specification for daylight savings start rules in US. More...

#include <local_timezone_defs.hpp>

Public Types

typedef date_type::day_of_week_type day_of_week_type
 
typedef date_type::month_type month_type
 
typedef date_type::year_type year_type
 
typedef
date_time::nth_kday_of_month
< date_type > 
start_rule_functor
 
typedef
date_time::first_kday_of_month
< date_type > 
end_rule_functor
 
typedef
date_time::first_kday_of_month
< date_type > 
start_rule_functor_pre2007
 
typedef
date_time::last_kday_of_month
< date_type > 
end_rule_functor_pre2007
 

Static Public Member Functions

static day_of_week_type start_day (year_type)
 
static month_type start_month (year_type y)
 
static day_of_week_type end_day (year_type)
 
static month_type end_month (year_type y)
 
static date_type local_dst_start_day (year_type year)
 
static date_type local_dst_end_day (year_type year)
 
static int dst_start_offset_minutes ()
 
static int dst_end_offset_minutes ()
 
static int dst_shift_length_minutes ()
 

Detailed Description

template<class date_type>
struct boost::date_time::us_dst_trait< date_type >

Specification for daylight savings start rules in US.

This class is used to configure dst_calc_engine template typically as follows:

using namespace boost::gregorian;
using namespace boost::posix_time;
typedef us_dst_trait<date> us_dst_traits;
us_dst_traits>
us_dst_calc;
//calculate the 2002 transition day of USA April 7 2002
date dst_start = us_dst_calc::local_dst_start_day(2002);
//calculate the 2002 transition day of USA Oct 27 2002
date dst_end = us_dst_calc::local_dst_end_day(2002);
//check if a local time is in dst or not -- posible answers
//are yes, no, invalid time label, ambiguous
ptime t(...some time...);
if (us_dst::local_is_dst(t.date(), t.time_of_day())
{
}

This generates a type suitable for the calculation of dst transitions for the United States. Of course other templates can be used for other locales.

Member Typedef Documentation

template<class date_type >
typedef date_type::day_of_week_type boost::date_time::us_dst_trait< date_type >::day_of_week_type
template<class date_type >
typedef date_time::first_kday_of_month<date_type> boost::date_time::us_dst_trait< date_type >::end_rule_functor
template<class date_type >
typedef date_time::last_kday_of_month<date_type> boost::date_time::us_dst_trait< date_type >::end_rule_functor_pre2007
template<class date_type >
typedef date_type::month_type boost::date_time::us_dst_trait< date_type >::month_type
template<class date_type >
typedef date_time::nth_kday_of_month<date_type> boost::date_time::us_dst_trait< date_type >::start_rule_functor
template<class date_type >
typedef date_time::first_kday_of_month<date_type> boost::date_time::us_dst_trait< date_type >::start_rule_functor_pre2007
template<class date_type >
typedef date_type::year_type boost::date_time::us_dst_trait< date_type >::year_type

Member Function Documentation

template<class date_type >
static int boost::date_time::us_dst_trait< date_type >::dst_end_offset_minutes ( )
inlinestatic
template<class date_type >
static int boost::date_time::us_dst_trait< date_type >::dst_shift_length_minutes ( )
inlinestatic
template<class date_type >
static int boost::date_time::us_dst_trait< date_type >::dst_start_offset_minutes ( )
inlinestatic
template<class date_type >
static day_of_week_type boost::date_time::us_dst_trait< date_type >::end_day ( year_type  )
inlinestatic
template<class date_type >
static month_type boost::date_time::us_dst_trait< date_type >::end_month ( year_type  y)
inlinestatic
template<class date_type >
static day_of_week_type boost::date_time::us_dst_trait< date_type >::start_day ( year_type  )
inlinestatic
template<class date_type >
static month_type boost::date_time::us_dst_trait< date_type >::start_month ( year_type  y)
inlinestatic

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