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::dst_calculator< date_type_, time_duration_type_ > Class Template Reference

Dynamic class used to caluclate dst transition information. More...

#include <dst_rules.hpp>

Public Types

typedef time_duration_type_ time_duration_type
 
typedef date_type_ date_type
 

Static Public Member Functions

static time_is_dst_result process_local_dst_start_day (const time_duration_type &time_of_day, unsigned int dst_start_offset_minutes, long dst_length_minutes)
 Check the local time offset when on dst start day. More...
 
static time_is_dst_result process_local_dst_end_day (const time_duration_type &time_of_day, unsigned int dst_end_offset_minutes, long dst_length_minutes)
 Check the local time offset when on the last day of dst. More...
 
static time_is_dst_result local_is_dst (const date_type &current_day, const time_duration_type &time_of_day, const date_type &dst_start_day, const time_duration_type &dst_start_offset, const date_type &dst_end_day, const time_duration_type &dst_end_offset, const time_duration_type &dst_length_minutes)
 Calculates if the given local time is dst or not. More...
 
static time_is_dst_result local_is_dst (const date_type &current_day, const time_duration_type &time_of_day, const date_type &dst_start_day, unsigned int dst_start_offset_minutes, const date_type &dst_end_day, unsigned int dst_end_offset_minutes, long dst_length_minutes)
 Calculates if the given local time is dst or not. More...
 

Detailed Description

template<class date_type_, class time_duration_type_>
class boost::date_time::dst_calculator< date_type_, time_duration_type_ >

Dynamic class used to caluclate dst transition information.

Member Typedef Documentation

template<class date_type_ , class time_duration_type_ >
typedef date_type_ boost::date_time::dst_calculator< date_type_, time_duration_type_ >::date_type
template<class date_type_ , class time_duration_type_ >
typedef time_duration_type_ boost::date_time::dst_calculator< date_type_, time_duration_type_ >::time_duration_type

Member Function Documentation

template<class date_type_ , class time_duration_type_ >
static time_is_dst_result boost::date_time::dst_calculator< date_type_, time_duration_type_ >::local_is_dst ( const date_type current_day,
const time_duration_type time_of_day,
const date_type dst_start_day,
const time_duration_type dst_start_offset,
const date_type dst_end_day,
const time_duration_type dst_end_offset,
const time_duration_type dst_length_minutes 
)
inlinestatic

Calculates if the given local time is dst or not.

Determines if the time is really in DST or not. Also checks for invalid and ambiguous.

Parameters
current_dayThe day to check for dst
time_of_dayTime offset within the day to check
dst_start_dayStarting day of dst for the given locality
dst_start_offsetTime offset within day for dst boundary
dst_end_dayEnding day of dst for the given locality
dst_end_offsetTime offset within day given in dst for dst boundary
dst_lengthlenght of dst adjusment
Return values
Thetime is either ambiguous, invalid, in dst, or not in dst

Referenced by boost::date_time::dst_calc_engine< date_type, time_duration_type, dst_traits >::local_is_dst(), and boost::date_time::us_dst_rules< date_type_, time_duration_type_, dst_start_offset_minutes, dst_length_minutes >::local_is_dst().

template<class date_type_ , class time_duration_type_ >
static time_is_dst_result boost::date_time::dst_calculator< date_type_, time_duration_type_ >::local_is_dst ( const date_type current_day,
const time_duration_type time_of_day,
const date_type dst_start_day,
unsigned int  dst_start_offset_minutes,
const date_type dst_end_day,
unsigned int  dst_end_offset_minutes,
long  dst_length_minutes 
)
inlinestatic

Calculates if the given local time is dst or not.

Determines if the time is really in DST or not. Also checks for invalid and ambiguous.

Parameters
current_dayThe day to check for dst
time_of_dayTime offset within the day to check
dst_start_dayStarting day of dst for the given locality
dst_start_offset_minutesOffset within day for dst boundary (eg 120 for US which is 02:00:00)
dst_end_dayEnding day of dst for the given locality
dst_end_offset_minutesOffset within day given in dst for dst boundary (eg 120 for US which is 02:00:00)
dst_length_minutesLength of dst adjusment (eg: 60 for US)
Return values
Thetime is either ambiguous, invalid, in dst, or not in dst

References boost::date_time::invalid_time_label, boost::date_time::is_in_dst, boost::date_time::is_not_in_dst, boost::date_time::dst_calculator< date_type_, time_duration_type_ >::process_local_dst_end_day(), and boost::date_time::dst_calculator< date_type_, time_duration_type_ >::process_local_dst_start_day().

template<class date_type_ , class time_duration_type_ >
static time_is_dst_result boost::date_time::dst_calculator< date_type_, time_duration_type_ >::process_local_dst_end_day ( const time_duration_type time_of_day,
unsigned int  dst_end_offset_minutes,
long  dst_length_minutes 
)
inlinestatic

Check the local time offset when on the last day of dst.

This is the calculation for the DST end day. On that day times prior to the conversion time - dst_length (1 am in US) are still in dst. Times between the above and the switch time are ambiguous. Times after the start_offset are not in dst.

Parameters
time_of_dayTime offset in the day for the local time
dst_end_offset_minutesLocal time of day for end of dst
Return values
statusof time label w.r.t. dst

References boost::date_time::ambiguous, boost::date_time::is_in_dst, boost::date_time::is_not_in_dst, and boost::asio::offset.

Referenced by boost::date_time::dst_calculator< date_type_, time_duration_type_ >::local_is_dst().

template<class date_type_ , class time_duration_type_ >
static time_is_dst_result boost::date_time::dst_calculator< date_type_, time_duration_type_ >::process_local_dst_start_day ( const time_duration_type time_of_day,
unsigned int  dst_start_offset_minutes,
long  dst_length_minutes 
)
inlinestatic

Check the local time offset when on dst start day.

On this dst transition, the time label between the transition boundary and the boudary + the offset are invalid times. If before the boundary then still not in dst.

Parameters
time_of_dayTime offset in the day for the local time
dst_start_offset_minutesLocal day offset for start of dst
dst_length_minutesNumber of minutes to adjust clock forward
Return values
statusof time label w.r.t. dst

References boost::date_time::invalid_time_label, boost::date_time::is_in_dst, boost::date_time::is_not_in_dst, and boost::asio::offset.

Referenced by boost::date_time::dst_calculator< date_type_, time_duration_type_ >::local_is_dst().


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