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::local_adjustor< time_type, utc_offset, dst_rule > Class Template Reference

Template that simplifies the creation of local time calculator. More...

#include <local_time_adjustor.hpp>

Public Types

typedef
time_type::time_duration_type 
time_duration_type
 
typedef time_type::date_type date_type
 
typedef
static_local_time_adjustor
< time_type, dst_rule,
utc_adjustment
< time_duration_type,
utc_offset > > 
dst_adjustor
 

Static Public Member Functions

static time_type utc_to_local (const time_type &t)
 Convert a utc time to local time. More...
 
static time_type local_to_utc (const time_type &t, date_time::dst_flags dst=date_time::calculate)
 Convert a local time to utc. More...
 

Detailed Description

template<class time_type, short utc_offset, class dst_rule>
class boost::date_time::local_adjustor< time_type, utc_offset, dst_rule >

Template that simplifies the creation of local time calculator.

Use this template to create the timezone to utc convertors as required.

This class will also work for other regions that don't use dst and have a utc offset which is an integral number of hours.

Template Parameters -time_type – Time class to use -utc_offset – Number hours local time is adjust from utc -use_dst – true (default) if region uses dst, false otherwise For example:

//eastern timezone is utc-5
typedef date_time::local_adjustor<ptime, -5, us_dst> us_eastern;
typedef date_time::local_adjustor<ptime, -6, us_dst> us_central;
typedef date_time::local_adjustor<ptime, -7, us_dst> us_mountain;
typedef date_time::local_adjustor<ptime, -8, us_dst> us_pacific;
typedef date_time::local_adjustor<ptime, -7, no_dst> us_arizona;

Member Typedef Documentation

template<class time_type , short utc_offset, class dst_rule >
typedef time_type::date_type boost::date_time::local_adjustor< time_type, utc_offset, dst_rule >::date_type
template<class time_type , short utc_offset, class dst_rule >
typedef static_local_time_adjustor<time_type, dst_rule, utc_adjustment<time_duration_type, utc_offset> > boost::date_time::local_adjustor< time_type, utc_offset, dst_rule >::dst_adjustor
template<class time_type , short utc_offset, class dst_rule >
typedef time_type::time_duration_type boost::date_time::local_adjustor< time_type, utc_offset, dst_rule >::time_duration_type

Member Function Documentation

template<class time_type , short utc_offset, class dst_rule >
static time_type boost::date_time::local_adjustor< time_type, utc_offset, dst_rule >::local_to_utc ( const time_type &  t,
date_time::dst_flags  dst = date_time::calculate 
)
inlinestatic
template<class time_type , short utc_offset, class dst_rule >
static time_type boost::date_time::local_adjustor< time_type, utc_offset, dst_rule >::utc_to_local ( const time_type &  t)
inlinestatic

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