Library Reference
The following is a detailed reference of the date_time library. A click on any of the reference links will take you to a list of the header files found in that section. Following one of those links will take you to a list of the items declared in that header file. Further sublinks take you to detailed descriptions of each individual item.

Date Time Reference

Header <boost/date_time/adjust_functors.hpp>

namespace boost {
  namespace date_time {
    template<typename date_type> class day_functor;
    template<typename date_type> class month_functor;
    template<typename date_type> class week_functor;
    template<typename date_type> class year_functor;
  }
}

boost::date_time::day_functor
Functor to iterate a fixed number of days.

template<typename date_type> 
class day_functor {
public:
  // types
  typedef date_type::duration_type duration_type;

  // construct/copy/destruct
  day_functor(int);

  // public member functions
  duration_type get_offset(const date_type &) const;
  duration_type get_neg_offset(const date_type &) const;
};

Description

day_functor construct/copy/destruct

day_functor(int f);

day_functor public member functions

duration_type get_offset(const date_type & d) const;

duration_type get_neg_offset(const date_type & d) const;

boost::date_time::month_functor
Provides calculation to find next nth month given a date.

template<typename date_type> 
class month_functor {
public:
  // types
  typedef date_type::duration_type duration_type;
  typedef date_type::calendar_type cal_type;     
  typedef cal_type::ymd_type       ymd_type;     
  typedef cal_type::day_type       day_type;     

  // construct/copy/destruct
  month_functor(int);

  // public member functions
  duration_type get_offset(const date_type &) const;
  duration_type get_neg_offset(const date_type &) const;
};

Description
This adjustment function provides the logic for 'month-based' advancement on a ymd based calendar. The policy it uses to handle the non existant end of month days is to back up to the last day of the month. Also, if the starting date is the last day of a month, this functor will attempt to adjust to the end of the month.

month_functor construct/copy/destruct

month_functor(int f);

month_functor public member functions

duration_type get_offset(const date_type & d) const;

duration_type get_neg_offset(const date_type & d) const;

Returns a negative duration_type.
boost::date_time::week_functor
Functor to iterate a over weeks.

template<typename date_type> 
class week_functor {
public:
  // types
  typedef date_type::duration_type duration_type;
  typedef date_type::calendar_type calendar_type;

  // construct/copy/destruct
  week_functor(int);

  // public member functions
  duration_type get_offset(const date_type &) const;
  duration_type get_neg_offset(const date_type &) const;
};

Description

week_functor construct/copy/destruct

week_functor(int f);

week_functor public member functions

duration_type get_offset(const date_type & d) const;

duration_type get_neg_offset(const date_type & d) const;

boost::date_time::year_functor
Functor to iterate by a year adjusting for leap years.

template<typename date_type> 
class year_functor {
public:
  // types
  typedef date_type::duration_type duration_type;

  // construct/copy/destruct
  year_functor(int);

  // public member functions
  duration_type get_offset(const date_type &) const;
  duration_type get_neg_offset(const date_type &) const;
};

Description

year_functor construct/copy/destruct

year_functor(int f);

year_functor public member functions

duration_type get_offset(const date_type & d) const;

duration_type get_neg_offset(const date_type & d) const;

Header <boost/date_time/c_local_time_adjustor.hpp>
Time adjustment calculations based on machine

namespace boost {
  namespace date_time {
    template<typename time_type> class c_local_adjustor;
  }
}

boost::date_time::c_local_adjustor
Adjust to / from utc using the C API.

template<typename time_type> 
class c_local_adjustor {
public:
  // types
  typedef time_type::time_duration_type time_duration_type;
  typedef time_type::date_type          date_type;         
  typedef date_type::duration_type      date_duration_type;

  // public static functions
  time_type utc_to_local(const time_type &) ;
};

Description
Warning!!! This class assumes that timezone settings of the machine are correct. This can be a very dangerous assumption.

c_local_adjustor public static functions

time_type utc_to_local(const time_type & t) ;

Convert a utc time to local time.

Header <boost/date_time/c_time.hpp>
Provide workarounds related to the ctime header

namespace std {
}

Header <boost/date_time/compiler_config.hpp>

namespace std {
}

Header <boost/date_time/constrained_value.hpp>

namespace boost {
  namespace CV {
    template<typename value_policies> class constrained_value;
    template<typename rep_type, rep_type min_value, rep_type max_value, 
             typename exception_type> 
      class simple_exception_policy;

    // Represent a min or max violation type. 
    enum violation_enum { min_violation, max_violation };
  }
}

boost::CV::constrained_value
A template to specify a constrained basic value type.

template<typename value_policies> 
class constrained_value {
public:
  // types
  typedef value_policies::value_type value_type;

  // construct/copy/destruct
  constrained_value(value_type);
  constrained_value& operator=(value_type);

  // public member functions
  operator value_type() const;

  // public static functions
  value_type max BOOST_PREVENT_MACRO_SUBSTITUTION() ;
  value_type min BOOST_PREVENT_MACRO_SUBSTITUTION() ;

  // private member functions
  void assign(value_type) ;
};

Description
This template provides a quick way to generate an integer type with a constrained range. The type provides for the ability to specify the min, max, and and error handling policy.
value policies A class that provides the range limits via the min and max functions as well as a function on_error that determines how errors are handled. A common strategy would be to assert or throw and exception. The on_error is passed both the current value and the new value that is in error.

constrained_value construct/copy/destruct

constrained_value(value_type value);

constrained_value& operator=(value_type v);

constrained_value public member functions

operator value_type() const;

Coerce into the representation type.

constrained_value public static functions

value_type max BOOST_PREVENT_MACRO_SUBSTITUTION() ;

Return the max allowed value (traits method).

value_type min BOOST_PREVENT_MACRO_SUBSTITUTION() ;

Return the min allowed value (traits method).

constrained_value private member functions

void assign(value_type value) ;

boost::CV::simple_exception_policy
Template to shortcut the constrained_value policy creation process.

template<typename rep_type, rep_type min_value, rep_type max_value, 
         typename exception_type> 
class simple_exception_policy {
public:
  // types
  typedef rep_type value_type;

  // public static functions
  rep_type min BOOST_PREVENT_MACRO_SUBSTITUTION() ;
  rep_type max BOOST_PREVENT_MACRO_SUBSTITUTION() ;
  void on_error(rep_type, rep_type, violation_enum) ;
};

Description

simple_exception_policy public static functions

rep_type min BOOST_PREVENT_MACRO_SUBSTITUTION() ;

rep_type max BOOST_PREVENT_MACRO_SUBSTITUTION() ;

void on_error(rep_type , rep_type , violation_enum ) ;

Header <boost/date_time/date.hpp>

namespace boost {
  namespace date_time {
    template<typename T, typename calendar, typename duration_type_> class date;
  }
}

boost::date_time::date
Representation of timepoint at the one day level resolution.

template<typename T, typename calendar, typename duration_type_> 
class date {
public:
  // types
  typedef T                          date_type;       
  typedef calendar                   calendar_type;   
  typedef calendar::date_traits_type traits_type;     
  typedef duration_type_             duration_type;   
  typedef calendar::year_type        year_type;       
  typedef calendar::month_type       month_type;      
  typedef calendar::day_type         day_type;        
  typedef calendar::ymd_type         ymd_type;        
  typedef calendar::date_rep_type    date_rep_type;   
  typedef calendar::date_int_type    date_int_type;   
  typedef calendar::day_of_week_type day_of_week_type;

  // construct/copy/destruct
  date(year_type, month_type, day_type);
  date(const ymd_type &);
  date(date_int_type);
  date(date_rep_type);

  // public member functions
  year_type year() const;
  month_type month() const;
  day_type day() const;
  day_of_week_type day_of_week() const;
  ymd_type year_month_day() const;
  bool operator<(const date_type &) const;
  bool operator==(const date_type &) const;
  bool is_special() const;
  bool is_not_a_date() const;
  bool is_infinity() const;
  bool is_pos_infinity() const;
  bool is_neg_infinity() const;
  special_values as_special() const;
  duration_type operator-(const date_type &) const;
  date_type operator-(const duration_type &) const;
  date_type operator-=(const duration_type &) ;
  date_rep_type day_count() const;
  date_type operator+(const duration_type &) const;
  date_type operator+=(const duration_type &) ;

  // protected member functions
};

Description
The date template represents an interface shell for a date class that is based on a year-month-day system such as the gregorian or iso systems. It provides basic operations to enable calculation and comparisons.
Theory
This date representation fundamentally departs from the C tm struct approach. The goal for this type is to provide efficient date operations (add, subtract) and storage (minimize space to represent) in a concrete class. Thus, the date uses a count internally to represent a particular date. The calendar parameter defines the policies for converting the the year-month-day and internal counted form here. Applications that need to perform heavy formatting of the same date repeatedly will perform better by using the year-month-day representation.
Internally the date uses a day number to represent the date. This is a monotonic time representation. This representation allows for fast comparison as well as simplifying the creation of writing numeric operations. Essentially, the internal day number is like adjusted julian day. The adjustment is determined by the Epoch date which is represented as day 1 of the calendar. Day 0 is reserved for negative infinity so that any actual date is automatically greater than negative infinity. When a date is constructed from a date or formatted for output, the appropriate conversions are applied to create the year, month, day representations.

date construct/copy/destruct

date(year_type y, month_type m, day_type d);

date(const ymd_type & ymd);

date(date_int_type days);

This is a private constructor which allows for the creation of new dates. It is not exposed to users since that would require class users to understand the inner workings of the date class.

date(date_rep_type days);

date public member functions

year_type year() const;

month_type month() const;

day_type day() const;

day_of_week_type day_of_week() const;

ymd_type year_month_day() const;

bool operator<(const date_type & rhs) const;

bool operator==(const date_type & rhs) const;

bool is_special() const;

check to see if date is a special value

bool is_not_a_date() const;

check to see if date is not a value

bool is_infinity() const;

check to see if date is one of the infinity values

bool is_pos_infinity() const;

check to see if date is greater than all possible dates

bool is_neg_infinity() const;

check to see if date is greater than all possible dates

special_values as_special() const;

return as a special value or a not_special if a normal date

duration_type operator-(const date_type & d) const;

date_type operator-(const duration_type & dd) const;

date_type operator-=(const duration_type & dd) ;

date_rep_type day_count() const;

date_type operator+(const duration_type & dd) const;

date_type operator+=(const duration_type & dd) ;

date protected member functions

Header <boost/date_time/date_clock_device.hpp>

namespace boost {
  namespace date_time {
    template<typename date_type> class day_clock;
  }
}

boost::date_time::day_clock
A clock providing day level services based on C time_t capabilities.

template<typename date_type> 
class day_clock {
public:
  // types
  typedef date_type::ymd_type ymd_type;

  // public static functions
  date_type local_day() ;
  date_type::ymd_type local_day_ymd() ;
  date_type::ymd_type universal_day_ymd() ;
  date_type universal_day() ;

  // private static functions
  ::std::tm * get_local_time() ;
  ::std::tm * get_universal_time() ;
};

Description
This clock uses Posix interfaces as its implementation and hence uses the timezone settings of the operating system. Incorrect user settings will result in incorrect results for the calls to local_day.

day_clock public static functions

date_type local_day() ;

Get the local day as a date type.

date_type::ymd_type local_day_ymd() ;

Get the local day as a ymd_type.

date_type::ymd_type universal_day_ymd() ;

Get the current day in universal date as a ymd_type.

date_type universal_day() ;

Get the UTC day as a date type.

day_clock private static functions

::std::tm * get_local_time() ;

::std::tm * get_universal_time() ;

Header <boost/date_time/date_defs.hpp>

namespace boost {
  namespace date_time {

    // An enumeration of weekday names. 
    enum weekdays { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, 
                    Saturday };

    // Simple enum to allow for nice programming with Jan, Feb, etc. 
    enum months_of_year { Jan = 1, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, 
                          Nov, Dec, NotAMonth, NumMonths };
  }
}

Header <boost/date_time/date_duration.hpp>

namespace boost {
  namespace date_time {
    template<typename duration_rep_traits> class date_duration;

    struct duration_traits_long;
    struct duration_traits_adapted;
  }
}

boost::date_time::date_duration
Duration type with date level resolution.

template<typename duration_rep_traits> 
class date_duration {
public:
  // types
  typedef duration_rep_traits::int_type  duration_rep_type;
  typedef duration_rep_traits::impl_type duration_rep;     

  // construct/copy/destruct
  date_duration(duration_rep);
  date_duration(special_values);
  date_duration(const date_duration< duration_rep_traits > &);

  // public member functions
  duration_rep get_rep() const;
  bool is_special() const;
  duration_rep_type days() const;
  bool operator==(const date_duration &) const;
  bool operator<(const date_duration &) const;
  date_duration operator-=(const date_duration &) ;
  date_duration operator+=(const date_duration &) ;
  date_duration operator-() const;
  date_duration< duration_rep_traits > operator/=(int) ;
  date_duration< duration_rep_traits > operator/(int) ;
  bool is_negative() const;

  // public static functions
  date_duration unit() ;
};

Description

date_duration construct/copy/destruct

date_duration(duration_rep day_count);

Construct from a day count.

date_duration(special_values sv);

construct from special_values - only works when instantiated with duration_traits_adapted

date_duration(const date_duration< duration_rep_traits > & other);

Construct from another date_duration (Copy Constructor).

date_duration public member functions

duration_rep get_rep() const;

returns days_ as it's instantiated type - used for streaming

bool is_special() const;

duration_rep_type days() const;

returns days as value, not object.

bool operator==(const date_duration & rhs) const;

Equality.

bool operator<(const date_duration & rhs) const;

Less.

date_duration operator-=(const date_duration & rhs) ;

Subtract another duration -- result is signed.

date_duration operator+=(const date_duration & rhs) ;

Add a duration -- result is signed.

date_duration operator-() const;

unary- Allows for dd = -date_duration(2); -> dd == -2

date_duration< duration_rep_traits > operator/=(int divisor) ;

Division operations on a duration with an integer.

date_duration< duration_rep_traits > operator/(int divisor) ;

bool is_negative() const;

return sign information

date_duration public static functions

date_duration unit() ;

Returns the smallest duration -- used by to calculate 'end'.
boost::date_time::duration_traits_long

struct duration_traits_long {
  // types
  typedef long int_type; 
  typedef long impl_type;

  // public static functions
  int_type as_number(impl_type) ;
};

Description
Struct for instantiating date_duration with NO special values functionality. Allows for transparent implementation of either date_duration<long> or date_duration<int_adapter<long> >

duration_traits_long public static functions

int_type as_number(impl_type i) ;

boost::date_time::duration_traits_adapted

struct duration_traits_adapted {
  // types
  typedef long                                  int_type; 
  typedef boost::date_time::int_adapter< long > impl_type;

  // public static functions
  int_type as_number(impl_type) ;
};

Description
Struct for instantiating date_duration WITH special values functionality. Allows for transparent implementation of either date_duration<long> or date_duration<int_adapter<long> >

duration_traits_adapted public static functions

int_type as_number(impl_type i) ;

Header <boost/date_time/date_duration_types.hpp>

namespace boost {
  namespace date_time {
    template<typename duration_config> class weeks_duration;
    template<typename base_config> class months_duration;
    template<typename base_config> class years_duration;
  }
}

boost::date_time::weeks_duration
Additional duration type that represents a number of n*7 days.

template<typename duration_config> 
class weeks_duration
  :  : public boost::date_time::date_duration< duration_config >
{
public:
  // construct/copy/destruct
  weeks_duration(typename duration_config::impl_type);
  weeks_duration(special_values);

  // public member functions
};

Description

weeks_duration construct/copy/destruct

weeks_duration(typename duration_config::impl_type w);

weeks_duration(special_values sv);

weeks_duration public member functions
boost::date_time::months_duration
additional duration type that represents a logical month

template<typename base_config> 
class months_duration {
public:
  // construct/copy/destruct
  months_duration(int_rep);
  months_duration(special_values);

  // public member functions
  int_rep number_of_months() const;
  duration_type get_neg_offset(const date_type &) const;
  duration_type get_offset(const date_type &) const;
  bool operator==(const months_type &) const;
  bool operator!=(const months_type &) const;
  months_type operator+(const months_type &) const;
  months_type & operator+=(const months_type &) ;
  months_type operator-(const months_type &) const;
  months_type & operator-=(const months_type &) ;
  months_type operator *(const int_type) const;
  months_type & operator *=(const int_type) ;
  months_type operator/(const int_type) const;
  months_type & operator/=(const int_type) ;
  months_type operator+(const years_type &) const;
  months_type & operator+=(const years_type &) ;
  months_type operator-(const years_type &) const;
  months_type & operator-=(const years_type &) ;
};

Description
A logical month enables things like: "date(2002,Mar,2) + months(2) -> 2002-May2". If the date is a last day-of-the-month, the result will also be a last-day-of-the-month.

months_duration construct/copy/destruct

months_duration(int_rep num);

months_duration(special_values sv);

months_duration public member functions

int_rep number_of_months() const;

duration_type get_neg_offset(const date_type & d) const;

returns a negative duration

duration_type get_offset(const date_type & d) const;

bool operator==(const months_type & rhs) const;

bool operator!=(const months_type & rhs) const;

months_type operator+(const months_type & rhs) const;

months_type & operator+=(const months_type & rhs) ;

months_type operator-(const months_type & rhs) const;

months_type & operator-=(const months_type & rhs) ;

months_type operator *(const int_type rhs) const;

months_type & operator *=(const int_type rhs) ;

months_type operator/(const int_type rhs) const;

months_type & operator/=(const int_type rhs) ;

months_type operator+(const years_type & y) const;

months_type & operator+=(const years_type & y) ;

months_type operator-(const years_type & y) const;

months_type & operator-=(const years_type & y) ;

boost::date_time::years_duration
additional duration type that represents a logical year

template<typename base_config> 
class years_duration {
public:
  // construct/copy/destruct
  years_duration(int_rep);
  years_duration(special_values);

  // public member functions
  int_rep number_of_years() const;
  duration_type get_neg_offset(const date_type &) const;
  duration_type get_offset(const date_type &) const;
  bool operator==(const years_type &) const;
  bool operator!=(const years_type &) const;
  years_type operator+(const years_type &) const;
  years_type & operator+=(const years_type &) ;
  years_type operator-(const years_type &) const;
  years_type & operator-=(const years_type &) ;
  years_type operator *(const int_type) const;
  years_type & operator *=(const int_type) ;
  years_type operator/(const int_type) const;
  years_type & operator/=(const int_type) ;
  months_type operator+(const months_type &) const;
  months_type operator-(const months_type &) const;
};

Description
A logical year enables things like: "date(2002,Mar,2) + years(2) -> 2004-Mar-2". If the date is a last day-of-the-month, the result will also be a last-day-of-the-month (ie date(2001-Feb-28) + years(3) -> 2004-Feb-29).

years_duration construct/copy/destruct

years_duration(int_rep num);

years_duration(special_values sv);

years_duration public member functions

int_rep number_of_years() const;

duration_type get_neg_offset(const date_type & d) const;

returns a negative duration

duration_type get_offset(const date_type & d) const;

bool operator==(const years_type & rhs) const;

bool operator!=(const years_type & rhs) const;

years_type operator+(const years_type & rhs) const;

years_type & operator+=(const years_type & rhs) ;

years_type operator-(const years_type & rhs) const;

years_type & operator-=(const years_type & rhs) ;

years_type operator *(const int_type rhs) const;

years_type & operator *=(const int_type rhs) ;

years_type operator/(const int_type rhs) const;

years_type & operator/=(const int_type rhs) ;

months_type operator+(const months_type & m) const;

months_type operator-(const months_type & m) const;

Header <boost/date_time/date_format_simple.hpp>

namespace boost {
  namespace date_time {
    template<typename charT> class simple_format;

    template<> class simple_format<wchar_t>;
  }
}

boost::date_time::simple_format
Class to provide simple basic formatting rules.

template<typename charT> 
class simple_format {
public:

  // public static functions
  const charT * not_a_date() ;
  const charT * pos_infinity() ;
  const charT * neg_infinity() ;
  month_format_spec month_format() ;
  ymd_order_spec date_order() ;
  bool has_date_sep_chars() ;
  charT year_sep_char() ;
  charT month_sep_char() ;
  charT day_sep_char() ;
  charT hour_sep_char() ;
  charT minute_sep_char() ;
  charT second_sep_char() ;
};

Description

simple_format public static functions

const charT * not_a_date() ;

String used printed is date is invalid.

const charT * pos_infinity() ;

String used to for positive infinity value.

const charT * neg_infinity() ;

String used to for positive infinity value.

month_format_spec month_format() ;

Describe month format.

ymd_order_spec date_order() ;

bool has_date_sep_chars() ;

This format uses '-' to separate date elements.

charT year_sep_char() ;

Char to sep?

charT month_sep_char() ;

char between year-month

charT day_sep_char() ;

Char to separate month-day.

charT hour_sep_char() ;

char between date-hours

charT minute_sep_char() ;

char between hour and minute

charT second_sep_char() ;

char for second

Specializations
Class simple_format<wchar_t>
boost::date_time::simple_format<wchar_t>
Specialization of formmating rules for wchar_t.

class simple_format<wchar_t> {
public:

  // public static functions
  const wchar_t * not_a_date() ;
  const wchar_t * pos_infinity() ;
  const wchar_t * neg_infinity() ;
  month_format_spec month_format() ;
  ymd_order_spec date_order() ;
  bool has_date_sep_chars() ;
  wchar_t year_sep_char() ;
  wchar_t month_sep_char() ;
  wchar_t day_sep_char() ;
  wchar_t hour_sep_char() ;
  wchar_t minute_sep_char() ;
  wchar_t second_sep_char() ;
};

Description

simple_format public static functions

const wchar_t * not_a_date() ;

String used printed is date is invalid.

const wchar_t * pos_infinity() ;

String used to for positive infinity value.

const wchar_t * neg_infinity() ;

String used to for positive infinity value.

month_format_spec month_format() ;

Describe month format.

ymd_order_spec date_order() ;

bool has_date_sep_chars() ;

This format uses '-' to separate date elements.

wchar_t year_sep_char() ;

Char to sep?

wchar_t month_sep_char() ;

char between year-month

wchar_t day_sep_char() ;

Char to separate month-day.

wchar_t hour_sep_char() ;

char between date-hours

wchar_t minute_sep_char() ;

char between hour and minute

wchar_t second_sep_char() ;

char for second

Header <boost/date_time/date_formatting.hpp>

namespace boost {
  namespace date_time {
    template<typename month_type, typename format_type, typename charT = char> 
      class month_formatter;
    template<typename ymd_type, typename format_type, typename charT = char> 
      class ymd_formatter;
    template<typename date_type, typename format_type, typename charT = char> 
      class date_formatter;
  }
}

boost::date_time::month_formatter
Formats a month as as string into an ostream.

template<typename month_type, typename format_type, typename charT = char> 
class month_formatter {
public:

  // public static functions
  std::basic_ostream< charT > & 
  format_month(const month_type &, std::basic_ostream< charT > &) ;
  std::ostream & format_month(const month_type &, std::ostream &) ;
};

Description

month_formatter public static functions

std::basic_ostream< charT > & 
format_month(const month_type & month, std::basic_ostream< charT > & os) ;

Formats a month as as string into an ostream.
This function demands that month_type provide functions for converting to short and long strings if that capability is used.

std::ostream & format_month(const month_type & month, std::ostream & os) ;

Formats a month as as string into an ostream.
This function demands that month_type provide functions for converting to short and long strings if that capability is used.
boost::date_time::ymd_formatter
Convert ymd to a standard string formatting policies.

template<typename ymd_type, typename format_type, typename charT = char> 
class ymd_formatter {
public:

  // public static functions
  std::basic_string< charT > ymd_to_string(ymd_type) ;
  std::string ymd_to_string(ymd_type) ;
};

Description

ymd_formatter public static functions

std::basic_string< charT > ymd_to_string(ymd_type ymd) ;

Convert ymd to a standard string formatting policies.
This is standard code for handling date formatting with year-month-day based date information. This function uses the format_type to control whether the string will contain separator characters, and if so what the character will be. In addtion, it can format the month as either an integer or a string as controled by the formatting policy

std::string ymd_to_string(ymd_type ymd) ;

Convert ymd to a standard string formatting policies.
This is standard code for handling date formatting with year-month-day based date information. This function uses the format_type to control whether the string will contain separator characters, and if so what the character will be. In addtion, it can format the month as either an integer or a string as controled by the formatting policy
boost::date_time::date_formatter
Convert a date to string using format policies.

template<typename date_type, typename format_type, typename charT = char> 
class date_formatter {
public:
  // types
  typedef std::basic_string< charT > string_type;

  // public static functions
  string_type date_to_string(date_type) ;
  std::string date_to_string(date_type) ;
};

Description

date_formatter public static functions

string_type date_to_string(date_type d) ;

Convert to a date to standard string using format policies.

std::string date_to_string(date_type d) ;

Convert to a date to standard string using format policies.

Header <boost/date_time/date_formatting_limited.hpp>

namespace boost {
  namespace date_time {
  }
}

Header <boost/date_time/date_formatting_locales.hpp>

namespace boost {
  namespace date_time {
    template<typename facet_type, typename charT = char> 
      class ostream_month_formatter;
    template<typename weekday_type, typename facet_type, 
             typename charT = char> 
      class ostream_weekday_formatter;
    template<typename ymd_type, typename facet_type, typename charT = char> 
      class ostream_ymd_formatter;
    template<typename date_type, typename facet_type, typename charT = char> 
      class ostream_date_formatter;
  }
}

boost::date_time::ostream_month_formatter
Formats a month as as string into an ostream.

template<typename facet_type, typename charT = char> 
class ostream_month_formatter {
public:
  // types
  typedef facet_type::month_type      month_type;  
  typedef std::basic_ostream< charT > ostream_type;

  // public static functions
  void format_month(const month_type &, ostream_type &, const facet_type &) ;
};

Description

ostream_month_formatter public static functions

void format_month(const month_type & month, ostream_type & os, 
                  const facet_type & f) ;

Formats a month as as string into an output iterator.
boost::date_time::ostream_weekday_formatter
Formats a weekday.

template<typename weekday_type, typename facet_type, typename charT = char> 
class ostream_weekday_formatter {
public:
  // types
  typedef facet_type::month_type      month_type;  
  typedef std::basic_ostream< charT > ostream_type;

  // public static functions
  void format_weekday(const weekday_type &, ostream_type &, 
                      const facet_type &, bool) ;
};

Description

ostream_weekday_formatter public static functions

void format_weekday(const weekday_type & wd, ostream_type & os, 
                    const facet_type & f, bool as_long_string) ;

Formats a month as as string into an output iterator.
boost::date_time::ostream_ymd_formatter
Convert ymd to a standard string formatting policies.

template<typename ymd_type, typename facet_type, typename charT = char> 
class ostream_ymd_formatter {
public:
  // types
  typedef ymd_type::month_type                         month_type;          
  typedef ostream_month_formatter< facet_type, charT > month_formatter_type;
  typedef std::basic_ostream< charT >                  ostream_type;        
  typedef std::basic_string< charT >                   foo_type;            

  // public static functions
  void ymd_put(ymd_type, ostream_type &, const facet_type &) ;
};

Description

ostream_ymd_formatter public static functions

void ymd_put(ymd_type ymd, ostream_type & os, const facet_type & f) ;

Convert ymd to a standard string formatting policies.
This is standard code for handling date formatting with year-month-day based date information. This function uses the format_type to control whether the string will contain separator characters, and if so what the character will be. In addtion, it can format the month as either an integer or a string as controled by the formatting policy
boost::date_time::ostream_date_formatter
Convert a date to string using format policies.

template<typename date_type, typename facet_type, typename charT = char> 
class ostream_date_formatter {
public:
  // types
  typedef std::basic_ostream< charT > ostream_type;
  typedef date_type::ymd_type         ymd_type;    

  // public static functions
  void date_put(const date_type &, ostream_type &, const facet_type &) ;
  void date_put(const date_type &, ostream_type &) ;
};

Description

ostream_date_formatter public static functions

void date_put(const date_type & d, ostream_type & os, const facet_type & f) ;

Put date into an ostream.

void date_put(const date_type & d, ostream_type & os) ;

Put date into an ostream.

Header <boost/date_time/date_generators.hpp>
Definition and implementation of date algorithm templates

namespace boost {
  namespace date_time {
    template<typename date_type> class year_based_generator;
    template<typename date_type> class partial_date;
    template<typename date_type> class nth_kday_of_month;
    template<typename date_type> class first_kday_of_month;
    template<typename date_type> class last_kday_of_month;
    template<typename date_type> class first_kday_after;
    template<typename date_type> class first_kday_before;

    // Returns nth arg as string. 1 -> "first", 2 -> "second", max is 5. 
    BOOST_DATE_TIME_DECL const char * nth_as_str(int n);
    template<typename date_type, typename weekday_type> 
      date_type::duration_type 
      days_until_weekday(const date_type &, const weekday_type &);
    template<typename date_type, typename weekday_type> 
      date_type::duration_type 
      days_before_weekday(const date_type &, const weekday_type &);
    template<typename date_type, typename weekday_type> 
      date_type next_weekday(const date_type &, const weekday_type &);
    template<typename date_type, typename weekday_type> 
      date_type previous_weekday(const date_type &, const weekday_type &);
  }
}

boost::date_time::year_based_generator
Base class for all generators that take a year and produce a date.

template<typename date_type> 
class year_based_generator {
public:
  // types
  typedef date_type::calendar_type calendar_type;
  typedef calendar_type::year_type year_type;    

  // construct/copy/destruct
  year_based_generator();
  ~year_based_generator();

  // public member functions
  virtual date_type get_date(year_type) const;
};

Description
This class is a base class for polymorphic function objects that take a year and produce a concrete date.

year_based_generator construct/copy/destruct

year_based_generator();

~year_based_generator();

year_based_generator public member functions

virtual date_type get_date(year_type y) const;

boost::date_time::partial_date
Generates a date by applying the year to the given month and day.

template<typename date_type> 
class partial_date
  :  : public boost::date_time::year_based_generator< date_type >
{
public:
  // types
  typedef date_type::calendar_type    calendar_type;
  typedef calendar_type::day_type     day_type;     
  typedef calendar_type::month_type   month_type;   
  typedef calendar_type::year_type    year_type;    
  typedef date_type::duration_type    duration_type;
  typedef duration_type::duration_rep duration_rep; 

  // construct/copy/destruct
  partial_date(day_type, month_type);
  partial_date(duration_rep);

  // public member functions
  date_type get_date(year_type) const;
  date_type operator()(year_type) const;
  bool operator==(const partial_date &) const;
  bool operator<(const partial_date &) const;
  month_type month() const;
  day_type day() const;
};

Description
Example usage:

    partial_date pd(1, Jan);
    partial_date pd2(70);
    date d = pd.get_date(2002); //2002-Jan-01
    date d2 = pd2.get_date(2002); //2002-Mar-10

partial_date construct/copy/destruct

partial_date(day_type d, month_type m);

partial_date(duration_rep days);

Partial date created from number of days into year. Range 1-366.
Allowable values range from 1 to 366. 1=Jan1, 366=Dec31. If argument exceeds range, partial_date will be created with closest in-range value. 60 will always be Feb29, if get_date() is called with a non-leap year an exception will be thrown

partial_date public member functions

date_type get_date(year_type y) const;

Return a concrete date when provided with a year specific year.
Will throw an 'invalid_argument' exception if a partial_date object, instantiated with Feb-29, has get_date called with a non-leap year. Example:

 partial_date pd(29, Feb);
 pd.get_date(2003); // throws invalid_argument exception
 pg.get_date(2000); // returns 2000-2-29

date_type operator()(year_type y) const;

bool operator==(const partial_date & rhs) const;

bool operator<(const partial_date & rhs) const;

month_type month() const;

day_type day() const;

boost::date_time::nth_kday_of_month
Useful generator functor for finding holidays.

template<typename date_type> 
class nth_kday_of_month
  :  : public boost::date_time::year_based_generator< date_type >
{
public:
  // types
  typedef date_type::calendar_type        calendar_type;   
  typedef calendar_type::day_of_week_type day_of_week_type;
  typedef calendar_type::month_type       month_type;      
  typedef calendar_type::year_type        year_type;       
  typedef date_type::duration_type        duration_type;   

  // construct/copy/destruct
  nth_kday_of_month(week_num, day_of_week_type, month_type);

  // public member functions
  date_type get_date(year_type) const;
  month_type month() const;
  week_num nth_week() const;
  day_of_week_type day_of_week() const;
  const char * nth_week_as_str() const;
};

Description
Based on the idea in Cal. Calc. for finding holidays that are the 'first Monday of September'. When instantiated with 'fifth' kday of month, the result will be the last kday of month which can be the fourth or fifth depending on the structure of the month.
The algorithm here basically guesses for the first day of the month. Then finds the first day of the correct type. That is, if the first of the month is a Tuesday and it needs Wenesday then we simply increment by a day and then we can add the length of a week until we get to the 'nth kday'. There are probably more efficient algorithms based on using a mod 7, but this one works reasonably well for basic applications.

nth_kday_of_month construct/copy/destruct

nth_kday_of_month(week_num week_no, day_of_week_type dow, month_type m);

nth_kday_of_month public member functions

date_type get_date(year_type y) const;

Return a concrete date when provided with a year specific year.

month_type month() const;

week_num nth_week() const;

day_of_week_type day_of_week() const;

const char * nth_week_as_str() const;

boost::date_time::first_kday_of_month
Useful generator functor for finding holidays and daylight savings.

template<typename date_type> 
class first_kday_of_month
  :  : public boost::date_time::year_based_generator< date_type >
{
public:
  // types
  typedef date_type::calendar_type        calendar_type;   
  typedef calendar_type::day_of_week_type day_of_week_type;
  typedef calendar_type::month_type       month_type;      
  typedef calendar_type::year_type        year_type;       
  typedef date_type::duration_type        duration_type;   

  // construct/copy/destruct
  first_kday_of_month(day_of_week_type, month_type);

  // public member functions
  date_type get_date(year_type) const;
  month_type month() const;
  day_of_week_type day_of_week() const;
};

Description
Similar to nth_kday_of_month, but requires less paramters

first_kday_of_month construct/copy/destruct

first_kday_of_month(day_of_week_type dow, month_type m);

Specify the first 'Sunday' in 'April' spec.

Parameters
dow	The day of week, eg: Sunday, Monday, etc
m	The month of the year, eg: Jan, Feb, Mar, etc

first_kday_of_month public member functions

date_type get_date(year_type year) const;

Return a concrete date when provided with a year specific year.

month_type month() const;

day_of_week_type day_of_week() const;

boost::date_time::last_kday_of_month
Calculate something like Last Sunday of January.

template<typename date_type> 
class last_kday_of_month
  :  : public boost::date_time::year_based_generator< date_type >
{
public:
  // types
  typedef date_type::calendar_type        calendar_type;   
  typedef calendar_type::day_of_week_type day_of_week_type;
  typedef calendar_type::month_type       month_type;      
  typedef calendar_type::year_type        year_type;       
  typedef date_type::duration_type        duration_type;   

  // construct/copy/destruct
  last_kday_of_month(day_of_week_type, month_type);

  // public member functions
  date_type get_date(year_type) const;
  month_type month() const;
  day_of_week_type day_of_week() const;
};

Description
Useful generator functor for finding holidays and daylight savings Get the last day of the month and then calculate the difference to the last previous day.

last_kday_of_month construct/copy/destruct

last_kday_of_month(day_of_week_type dow, month_type m);

Specify the date spec like last 'Sunday' in 'April' spec.

Parameters
dow	The day of week, eg: Sunday, Monday, etc
m	The month of the year, eg: Jan, Feb, Mar, etc

last_kday_of_month public member functions

date_type get_date(year_type year) const;

Return a concrete date when provided with a year specific year.

month_type month() const;

day_of_week_type day_of_week() const;

boost::date_time::first_kday_after
Calculate something like "First Sunday after Jan 1,2002.

template<typename date_type> 
class first_kday_after {
public:
  // types
  typedef date_type::calendar_type        calendar_type;   
  typedef calendar_type::day_of_week_type day_of_week_type;
  typedef date_type::duration_type        duration_type;   

  // construct/copy/destruct
  first_kday_after(day_of_week_type);

  // public member functions
  date_type get_date(date_type) const;
  day_of_week_type day_of_week() const;
};

Description
Date generator that takes a date and finds kday after

     typedef boost::date_time::first_kday_after<date> firstkdayafter;
     firstkdayafter fkaf(Monday);
     fkaf.get_date(date(2002,Feb,1));

first_kday_after construct/copy/destruct

first_kday_after(day_of_week_type dow);

first_kday_after public member functions

date_type get_date(date_type start_day) const;

Return next kday given.

day_of_week_type day_of_week() const;

boost::date_time::first_kday_before
Calculate something like "First Sunday before Jan 1,2002.

template<typename date_type> 
class first_kday_before {
public:
  // types
  typedef date_type::calendar_type        calendar_type;   
  typedef calendar_type::day_of_week_type day_of_week_type;
  typedef date_type::duration_type        duration_type;   

  // construct/copy/destruct
  first_kday_before(day_of_week_type);

  // public member functions
  date_type get_date(date_type) const;
  day_of_week_type day_of_week() const;
};

Description
Date generator that takes a date and finds kday after

     typedef boost::date_time::first_kday_before<date> firstkdaybefore;
     firstkdaybefore fkbf(Monday);
     fkbf.get_date(date(2002,Feb,1));

first_kday_before construct/copy/destruct

first_kday_before(day_of_week_type dow);

first_kday_before public member functions

date_type get_date(date_type start_day) const;

Return next kday given.

day_of_week_type day_of_week() const;

boost::date_time::days_until_weekday
Calculates the number of days until the next weekday.

template<typename date_type, typename weekday_type> 
  date_type::duration_type 
  days_until_weekday(const date_type & d, const weekday_type & wd);

Description
Calculates the number of days until the next weekday. If the date given falls on a Sunday and the given weekday is Tuesday the result will be 2 days
boost::date_time::days_before_weekday
Calculates the number of days since the previous weekday.

template<typename date_type, typename weekday_type> 
  date_type::duration_type 
  days_before_weekday(const date_type & d, const weekday_type & wd);

Description
Calculates the number of days since the previous weekday If the date given falls on a Sunday and the given weekday is Tuesday the result will be 5 days. The answer will be a positive number because Tuesday is 5 days before Sunday, not -5 days before.
boost::date_time::next_weekday
Generates a date object representing the date of the following weekday from the given date.

template<typename date_type, typename weekday_type> 
  date_type next_weekday(const date_type & d, const weekday_type & wd);

Description
Generates a date object representing the date of the following weekday from the given date. If the date given is 2004-May-9 (a Sunday) and the given weekday is Tuesday then the resulting date will be 2004-May-11.
boost::date_time::previous_weekday
Generates a date object representing the date of the previous weekday from the given date.

template<typename date_type, typename weekday_type> 
  date_type previous_weekday(const date_type & d, const weekday_type & wd);

Description
Generates a date object representing the date of the previous weekday from the given date. If the date given is 2004-May-9 (a Sunday) and the given weekday is Tuesday then the resulting date will be 2004-May-4.

Header <boost/date_time/date_iterator.hpp>

namespace boost {
  namespace date_time {
    template<typename date_type> class date_itr_base;
    template<typename offset_functor, typename date_type> class date_itr;

    // An iterator over dates with varying resolution (day, week, month, year, etc). 
    enum date_resolutions { day, week, months, year, decade, century, 
                            NumDateResolutions };
  }
}

boost::date_time::date_itr_base
Base date iterator type.

template<typename date_type> 
class date_itr_base {
public:
  // types
  typedef date_type::duration_type duration_type;    
  typedef date_type                value_type;       
  typedef std::input_iterator_tag  iterator_category;

  // construct/copy/destruct
  date_itr_base(date_type);
  ~date_itr_base();

  // public member functions
  date_itr_base & operator++() ;
  date_itr_base & operator--() ;
  virtual duration_type get_offset(const date_type &) const;
  virtual duration_type get_neg_offset(const date_type &) const;
  date_type operator *() ;
  date_type * operator->() ;
  bool operator<(const date_type &) ;
  bool operator<=(const date_type &) ;
  bool operator>(const date_type &) ;
  bool operator>=(const date_type &) ;
  bool operator==(const date_type &) ;
  bool operator!=(const date_type &) ;
};

Description
This class provides the skeleton for the creation of iterators. New and interesting interators can be created by plugging in a new function that derives the next value from the current state. generation of various types of -based information.
Template Parameters
date_type
The date_type is a concrete date_type. The date_type must define a duration_type and a calendar_type.

date_itr_base construct/copy/destruct

date_itr_base(date_type d);

~date_itr_base();

date_itr_base public member functions

date_itr_base & operator++() ;

date_itr_base & operator--() ;

virtual duration_type get_offset(const date_type & current) const;

virtual duration_type get_neg_offset(const date_type & current) const;

date_type operator *() ;

date_type * operator->() ;

bool operator<(const date_type & d) ;

bool operator<=(const date_type & d) ;

bool operator>(const date_type & d) ;

bool operator>=(const date_type & d) ;

bool operator==(const date_type & d) ;

bool operator!=(const date_type & d) ;

boost::date_time::date_itr
Overrides the base date iterator providing hook for functors.

template<typename offset_functor, typename date_type> 
class date_itr : public boost::date_time::date_itr_base< date_type > {
public:
  // types
  typedef date_type::duration_type duration_type;

  // construct/copy/destruct
  date_itr(date_type, int = 1);

  // public member functions

  // private member functions
  virtual duration_type get_offset(const date_type &) const;
  virtual duration_type get_neg_offset(const date_type &) const;
};

Description

date_itr construct/copy/destruct

date_itr(date_type d, int factor = 1);

date_itr public member functions

date_itr private member functions

virtual duration_type get_offset(const date_type & current) const;

virtual duration_type get_neg_offset(const date_type & current) const;

Header <boost/date_time/date_names_put.hpp>

namespace boost {
  namespace date_time {
    template<typename Config, typename charT = char, 
             typename OutputIterator = std::ostreambuf_iterator<charT> > 
      class date_names_put;
    template<typename Config, typename charT = char, 
             typename OutputIterator = std::ostreambuf_iterator<charT> > 
      class all_date_names_put;
  }
}

boost::date_time::date_names_put
Output facet base class for gregorian dates.

template<typename Config, typename charT = char, 
         typename OutputIterator = std::ostreambuf_iterator<charT> > 
class date_names_put {
public:
  // types
  typedef OutputIterator             iter_type;         
  typedef Config::month_type         month_type;        
  typedef Config::month_enum         month_enum;        
  typedef Config::weekday_enum       weekday_enum;      
  typedef Config::special_value_enum special_value_enum;
  typedef std::basic_string< charT > string_type;       

  // construct/copy/destruct
  date_names_put();

  // public member functions
  void put_special_value(iter_type &, special_value_enum) const;
  void put_month_short(iter_type &, month_enum) const;
  void put_month_long(iter_type &, month_enum) const;
  void put_weekday_short(iter_type &, weekday_enum) const;
  void put_weekday_long(iter_type &, weekday_enum) const;
  bool has_date_sep_chars() const;
  void year_sep_char(iter_type &) const;
  void month_sep_char(iter_type &) const;
  void day_sep_char(iter_type &) const;
  ymd_order_spec date_order() const;
  month_format_spec month_format() const;

  // protected member functions
  virtual void do_put_month_short(iter_type &, month_enum) const;
  virtual void do_put_month_long(iter_type &, month_enum) const;
  virtual void do_put_special_value(iter_type &, special_value_enum) const;
  virtual void do_put_weekday_short(iter_type &, weekday_enum) const;
  virtual void do_put_weekday_long(iter_type &, weekday_enum) const;
  virtual bool do_has_date_sep_chars() const;
  virtual void do_year_sep_char(iter_type &) const;
  virtual void do_month_sep_char(iter_type &) const;
  virtual void do_day_sep_char(iter_type &) const;
  virtual ymd_order_spec do_date_order() const;
  virtual month_format_spec do_month_format() const;
  void put_string(iter_type &, const charT *const) const;
  void put_string(iter_type &, const string_type &) const;

  static std::locale::id id;
};

Description
This class is a base class for date facets used to localize the names of months and the names of days in the week.
Requirements of Config
define an enumeration month_enum that enumerates the months. The enumeration should be '1' based eg: Jan==1
define as_short_string and as_long_string
(see langer & kreft p334).

date_names_put construct/copy/destruct

date_names_put();

date_names_put public member functions

void put_special_value(iter_type & oitr, special_value_enum sv) const;

void put_month_short(iter_type & oitr, month_enum moy) const;

void put_month_long(iter_type & oitr, month_enum moy) const;

void put_weekday_short(iter_type & oitr, weekday_enum wd) const;

void put_weekday_long(iter_type & oitr, weekday_enum wd) const;

bool has_date_sep_chars() const;

void year_sep_char(iter_type & oitr) const;

void month_sep_char(iter_type & oitr) const;

char between year-month

void day_sep_char(iter_type & oitr) const;

Char to separate month-day.

ymd_order_spec date_order() const;

Determines the order to put the date elements.

month_format_spec month_format() const;

Determines if month is displayed as integer, short or long string.

date_names_put protected member functions

virtual void do_put_month_short(iter_type & oitr, month_enum moy) const;

Default facet implementation uses month_type defaults.

virtual void do_put_month_long(iter_type & oitr, month_enum moy) const;

Default facet implementation uses month_type defaults.

virtual void 
do_put_special_value(iter_type & oitr, special_value_enum sv) const;

Default facet implementation for special value types.

virtual void do_put_weekday_short(iter_type & , weekday_enum ) const;

virtual void do_put_weekday_long(iter_type & , weekday_enum ) const;

virtual bool do_has_date_sep_chars() const;

virtual void do_year_sep_char(iter_type & oitr) const;

virtual void do_month_sep_char(iter_type & oitr) const;

char between year-month

virtual void do_day_sep_char(iter_type & oitr) const;

Char to separate month-day.

virtual ymd_order_spec do_date_order() const;

Default for date order.

virtual month_format_spec do_month_format() const;

Default month format.

void put_string(iter_type & oi, const charT *const s) const;

void put_string(iter_type & oi, const string_type & s1) const;

boost::date_time::all_date_names_put
An date name output facet that takes an array of char* to define strings.

template<typename Config, typename charT = char, 
         typename OutputIterator = std::ostreambuf_iterator<charT> > 
class all_date_names_put : public boost::date_time::date_names_put< Config, charT, OutputIterator >
{
public:
  // types
  typedef OutputIterator             iter_type;         
  typedef Config::month_enum         month_enum;        
  typedef Config::weekday_enum       weekday_enum;      
  typedef Config::special_value_enum special_value_enum;

  // construct/copy/destruct
  all_date_names_put(const charT *const, const charT *const, 
                     const charT *const, const charT *const, 
                     const charT *const, charT = '-', 
                     ymd_order_spec = ymd_order_iso, 
                     month_format_spec = month_as_short_string);

  // public member functions
  const charT *const * get_short_month_names() const;
  const charT *const * get_long_month_names() const;
  const charT *const * get_special_value_names() const;
  const charT *const * get_short_weekday_names() const;
  const charT *const * get_long_weekday_names() const;

  // protected member functions
  virtual void do_put_month_short(iter_type &, month_enum) const;
  virtual void do_put_month_long(iter_type &, month_enum) const;
  virtual void do_put_special_value(iter_type &, special_value_enum) const;
  virtual void do_put_weekday_short(iter_type &, weekday_enum) const;
  virtual void do_put_weekday_long(iter_type &, weekday_enum) const;
  virtual void do_month_sep_char(iter_type &) const;
  virtual void do_day_sep_char(iter_type &) const;
  virtual ymd_order_spec do_date_order() const;
  virtual month_format_spec do_month_format() const;
};

Description

all_date_names_put construct/copy/destruct

all_date_names_put(const charT *const month_short_names, 
                   const charT *const month_long_names, 
                   const charT *const special_value_names, 
                   const charT *const weekday_short_names, 
                   const charT *const weekday_long_names, 
                   charT separator_char = '-', 
                   ymd_order_spec order_spec = ymd_order_iso, 
                   month_format_spec month_format = month_as_short_string);

all_date_names_put public member functions

const charT *const * get_short_month_names() const;

const charT *const * get_long_month_names() const;

const charT *const * get_special_value_names() const;

const charT *const * get_short_weekday_names() const;

const charT *const * get_long_weekday_names() const;

all_date_names_put protected member functions

virtual void do_put_month_short(iter_type & oitr, month_enum moy) const;

Generic facet that takes array of chars.

virtual void do_put_month_long(iter_type & oitr, month_enum moy) const;

Long month names.

virtual void 
do_put_special_value(iter_type & oitr, special_value_enum sv) const;

Special values names.

virtual void do_put_weekday_short(iter_type & oitr, weekday_enum wd) const;

virtual void do_put_weekday_long(iter_type & oitr, weekday_enum wd) const;

virtual void do_month_sep_char(iter_type & oitr) const;

char between year-month

virtual void do_day_sep_char(iter_type & oitr) const;

Char to separate month-day.

virtual ymd_order_spec do_date_order() const;

Set the date ordering.

virtual month_format_spec do_month_format() const;

Set the date ordering.

Header <boost/date_time/dst_rules.hpp>
Contains template class to provide static dst rule calculations

namespace boost {
  namespace date_time {
    template<typename date_type_, typename time_duration_type_> 
      class dst_calculator;
    template<typename date_type, typename time_duration_type, 
             typename dst_traits> 
      class dst_calc_engine;
    template<typename date_type_, typename time_duration_type_, 
             unsigned int dst_start_offset_minutes = , 
             short dst_length_minutes = > 
      class us_dst_rules;
    template<typename date_type_, typename time_duration_type_> 
      class null_dst_rules;

    enum time_is_dst_result { is_not_in_dst, is_in_dst, ambiguous, 
                              invalid_time_label };
  }
}

boost::date_time::dst_calculator
Dynamic class used to caluclate dst transition information.

template<typename date_type_, typename time_duration_type_> 
class dst_calculator {
public:
  // types
  typedef time_duration_type_ time_duration_type;
  typedef date_type_          date_type;         

  // public static functions
  time_is_dst_result 
  process_local_dst_start_day(const time_duration_type &, unsigned int, long) ;
  time_is_dst_result 
  process_local_dst_end_day(const time_duration_type &, unsigned int, long) ;
  time_is_dst_result 
  local_is_dst(const date_type &, const time_duration_type &, 
               const date_type &, unsigned int, const date_type &, 
               unsigned int, long) ;
};

Description

dst_calculator public static functions

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.
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
dst_length_minutes	Number of minutes to adjust clock forward
dst_start_offset_minutes	Local day offset for start of dst
time_of_day	Time offset in the day for the local time

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.
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
dst_end_offset_minutes	Local time of day for end of dst
time_of_day	Time offset in the day for the local time

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.
Determines if the time is really in DST or not. Also checks for invalid and ambiguous.

Parameters
current_day	The day to check for dst
dst_end_day	Ending day of dst for the given locality
dst_end_offset_minutes	Offset within day given in dst for dst boundary (eg 120 for US which is 02:00:00)
dst_length_minutes	Length of dst adjusment (eg: 60 for US)
dst_start_day	Starting day of dst for the given locality
dst_start_offset_minutes	Offset within day for dst boundary (eg 120 for US which is 02:00:00)
time_of_day	Time offset within the day to check
boost::date_time::dst_calc_engine
Compile-time configurable daylight savings time calculation engine.

template<typename date_type, typename time_duration_type, typename dst_traits> 
class dst_calc_engine {
public:
  // types
  typedef date_type::year_type                            year_type;    
  typedef date_type::calendar_type                        calendar_type;
  typedef dst_calculator< date_type, time_duration_type > dstcalc;      

  // public static functions
  time_is_dst_result 
  local_is_dst(const date_type &, const time_duration_type &) ;
  bool is_dst_boundary_day(date_type) ;
  time_duration_type dst_offset() ;
  date_type local_dst_start_day(year_type) ;
  date_type local_dst_end_day(year_type) ;
};

Description

dst_calc_engine public static functions

time_is_dst_result 
local_is_dst(const date_type & d, const time_duration_type & td) ;

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.

bool is_dst_boundary_day(date_type d) ;

time_duration_type dst_offset() ;

The time of day for the dst transition (eg: typically 01:00:00 or 02:00:00).

date_type local_dst_start_day(year_type year) ;

date_type local_dst_end_day(year_type year) ;

boost::date_time::us_dst_rules
Depricated: Class to calculate dst boundaries for US time zones.

template<typename date_type_, typename time_duration_type_, 
         unsigned int dst_start_offset_minutes = , 
         short dst_length_minutes = > 
class us_dst_rules {
public:
  // types
  typedef time_duration_type_                             time_duration_type;
  typedef date_type_                                      date_type;         
  typedef date_type::year_type                            year_type;         
  typedef date_type::calendar_type                        calendar_type;     
  typedef date_time::last_kday_of_month< date_type >      lkday;             
  typedef date_time::first_kday_of_month< date_type >     fkday;             
  typedef dst_calculator< date_type, time_duration_type > dstcalc;           

  // public static functions
  time_is_dst_result 
  local_is_dst(const date_type &, const time_duration_type &) ;
  bool is_dst_boundary_day(date_type) ;
  date_type local_dst_start_day(year_type) ;
  date_type local_dst_end_day(year_type) ;
  time_duration_type dst_offset() ;
};

Description

us_dst_rules public static functions

time_is_dst_result 
local_is_dst(const date_type & d, const time_duration_type & td) ;

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.

bool is_dst_boundary_day(date_type d) ;

date_type local_dst_start_day(year_type year) ;

date_type local_dst_end_day(year_type year) ;

time_duration_type dst_offset() ;

boost::date_time::null_dst_rules
Used for local time adjustments in places that don't use dst.

template<typename date_type_, typename time_duration_type_> 
class null_dst_rules {
public:
  // types
  typedef time_duration_type_ time_duration_type;
  typedef date_type_          date_type;         

  // public static functions
  time_is_dst_result 
  local_is_dst(const date_type &, const time_duration_type &) ;
  time_is_dst_result 
  utc_is_dst(const date_type &, const time_duration_type &) ;
  bool is_dst_boundary_day(date_type) ;
  time_duration_type dst_offset() ;
};

Description

null_dst_rules public static functions

time_is_dst_result 
local_is_dst(const date_type & , const time_duration_type & ) ;

Calculates if the given local time is dst or not.

time_is_dst_result 
utc_is_dst(const date_type & , const time_duration_type & ) ;

Calculates if the given utc time is in dst.

bool is_dst_boundary_day(date_type d) ;

time_duration_type dst_offset() ;

Header <boost/date_time/dst_transition_generators.hpp>

namespace boost {
  namespace date_time {
    template<typename date_type> class dst_day_calc_rule;
    template<typename spec> class day_calc_dst_rule;
  }
}

boost::date_time::dst_day_calc_rule
Defines base interface for calculating start and end date of daylight savings.

template<typename date_type> 
class dst_day_calc_rule {
public:
  // types
  typedef date_type::year_type year_type;

  // construct/copy/destruct
  ~dst_day_calc_rule();

  // public member functions
  virtual date_type start_day(year_type) const;
  virtual date_type end_day(year_type) const;
};

Description

dst_day_calc_rule construct/copy/destruct

~dst_day_calc_rule();

dst_day_calc_rule public member functions

virtual date_type start_day(year_type y) const;

virtual date_type end_day(year_type y) const;

boost::date_time::day_calc_dst_rule
Canonical form for a class that provides day rule calculation.

template<typename spec> 
class day_calc_dst_rule
  :  : public boost::date_time::dst_day_calc_rule< spec::date_type >
{
public:
  // types
  typedef spec::date_type      date_type; 
  typedef date_type::year_type year_type; 
  typedef spec::start_rule     start_rule;
  typedef spec::end_rule       end_rule;  

  // construct/copy/destruct
  day_calc_dst_rule(start_rule, end_rule);

  // public member functions
  virtual date_type start_day(year_type) const;
  virtual date_type end_day(year_type) const;
};

Description
This class is used to generate specific sets of dst rules

day_calc_dst_rule construct/copy/destruct

day_calc_dst_rule(start_rule dst_start, end_rule dst_end);

day_calc_dst_rule public member functions

virtual date_type start_day(year_type y) const;

virtual date_type end_day(year_type y) const;

Header <boost/date_time/filetime_functions.hpp>
Function(s) for converting between a FILETIME structure and a time object. This file is only available on systems that have BOOST_HAS_FTIME defined.

namespace boost {
  namespace date_time {
    template<typename time_type> time_type time_from_ftime(const FILETIME &);
  }
}

boost::date_time::time_from_ftime
Create a time object from an initialized FILETIME struct.

template<typename time_type> time_type time_from_ftime(const FILETIME & ft);

Description
Create a time object from an initialized FILETIME struct. A FILETIME struct holds 100-nanosecond units (0.0000001). When built with microsecond resolution the FILETIME's sub second value will be truncated. Nanosecond resolution has no truncation.

Header <boost/date_time/gregorian_calendar.hpp>

namespace boost {
  namespace date_time {
    template<typename ymd_type_, typename date_int_type_> 
      class gregorian_calendar_base;
  }
}

boost::date_time::gregorian_calendar_base
An implementation of the Gregorian calendar.

template<typename ymd_type_, typename date_int_type_> 
class gregorian_calendar_base {
public:
  // types
  typedef ymd_type_            ymd_type;       // define a type a date split into components 
  typedef ymd_type::month_type month_type;     // define a type for representing months 
  typedef ymd_type::day_type   day_type;       // define a type for representing days 
  typedef ymd_type::year_type  year_type;      // Type to hold a stand alone year value (eg: 2002). 
  typedef date_int_type_       date_int_type;  // Define the integer type to use for internal calculations. 

  // public static functions
  unsigned short day_of_week(const ymd_type &) ;
  int week_number(const ymd_type &) ;
  date_int_type day_number(const ymd_type &) ;
  date_int_type julian_day_number(const ymd_type &) ;
  long modjulian_day_number(const ymd_type &) ;
  ymd_type from_day_number(date_int_type) ;
  ymd_type from_julian_day_number(date_int_type) ;
  ymd_type from_modjulian_day_number(long) ;
  bool is_leap_year(year_type) ;
  unsigned short end_of_month_day(year_type, month_type) ;
  ymd_type epoch() ;
  unsigned short days_in_week() ;
};

Description
This is a parameterized implementation of a proleptic Gregorian Calendar that can be used in the creation of date systems or just to perform calculations. All the methods of this class are static functions, so the intent is to never create instances of this class.

gregorian_calendar_base public static functions

unsigned short day_of_week(const ymd_type & ymd) ;

int week_number(const ymd_type & ymd) ;

date_int_type day_number(const ymd_type & ymd) ;

date_int_type julian_day_number(const ymd_type & ymd) ;

long modjulian_day_number(const ymd_type & ymd) ;

ymd_type from_day_number(date_int_type ) ;

ymd_type from_julian_day_number(date_int_type ) ;

ymd_type from_modjulian_day_number(long ) ;

bool is_leap_year(year_type ) ;

unsigned short end_of_month_day(year_type y, month_type m) ;

ymd_type epoch() ;

unsigned short days_in_week() ;

Header <boost/date_time/int_adapter.hpp>

namespace boost {
  namespace date_time {
    template<typename int_type_> class int_adapter;
    template<typename charT, typename traits, typename int_type> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > &, 
                 const int_adapter< int_type > &);
  }
}

boost::date_time::int_adapter
Adapter to create integer types with +-infinity, and not a value.

template<typename int_type_> 
class int_adapter {
public:
  // types
  typedef int_type_ int_type;

  // construct/copy/destruct
  int_adapter(int_type);

  // public member functions
  bool is_infinity() const;
  bool is_pos_infinity() const;
  bool is_neg_infinity() const;
  bool is_nan() const;
  bool is_special() const;
  bool operator==(const int_adapter &) const;
  bool operator==(const int &) const;
  bool operator!=(const int_adapter &) const;
  bool operator!=(const int &) const;
  bool operator<(const int_adapter &) const;
  bool operator<(const int &) const;
  bool operator>(const int_adapter &) const;
  int_type as_number() const;
  special_values as_special() const;
  template<typename rhs_type> 
    int_adapter operator+(const int_adapter< rhs_type > &) const;
  int_adapter operator+(const int_type) const;
  template<typename rhs_type> 
    int_adapter operator-(const int_adapter< rhs_type > &) const;
  int_adapter operator-(const int_type) const;
  int_adapter operator *(const int_adapter &) const;
  int_adapter operator *(const int) const;
  int_adapter operator/(const int_adapter &) const;
  int_adapter operator/(const int) const;
  int_adapter operator%(const int_adapter &) const;
  int_adapter operator%(const int) const;

  // public static functions
  bool has_infinity() ;
  const int_adapter pos_infinity() ;
  const int_adapter neg_infinity() ;
  const int_adapter not_a_number() ;
  int_adapter max BOOST_PREVENT_MACRO_SUBSTITUTION() ;
  int_adapter min BOOST_PREVENT_MACRO_SUBSTITUTION() ;
  int_adapter from_special(special_values) ;
  bool is_inf(int_type) ;
  bool is_neg_inf(int_type) ;
  bool is_pos_inf(int_type) ;
  bool is_not_a_number(int_type) ;
  special_values to_special(int_type) ;
  int_type maxcount() ;

  // private member functions
  int compare(const int_adapter &) const;
  int_adapter mult_div_specials(const int_adapter &) const;
  int_adapter mult_div_specials(const int &) const;
};

Description
This class is used internally in counted date/time representations. It adds the floating point like features of infinities and not a number. It also provides mathmatical operations with consideration to special values following these rules:

  +infinity  -  infinity  == Not A Number (NAN)
   infinity  *  non-zero  == infinity
   infinity  *  zero      == NAN
  +infinity  * -integer   == -infinity
   infinity  /  infinity  == NAN
   infinity  *  infinity  == infinity 
 *

int_adapter construct/copy/destruct

int_adapter(int_type v);

int_adapter public member functions

bool is_infinity() const;

bool is_pos_infinity() const;

bool is_neg_infinity() const;

bool is_nan() const;

bool is_special() const;

bool operator==(const int_adapter & rhs) const;

bool operator==(const int & rhs) const;

bool operator!=(const int_adapter & rhs) const;

bool operator!=(const int & rhs) const;

bool operator<(const int_adapter & rhs) const;

bool operator<(const int & rhs) const;

bool operator>(const int_adapter & rhs) const;

int_type as_number() const;

special_values as_special() const;

Returns either special value type or is_not_special.

template<typename rhs_type> 
  int_adapter operator+(const int_adapter< rhs_type > & rhs) const;

Operator allows for adding dissimilar int_adapter types. The return type will match that of the the calling object's type

int_adapter operator+(const int_type rhs) const;

template<typename rhs_type> 
  int_adapter operator-(const int_adapter< rhs_type > & rhs) const;

Operator allows for subtracting dissimilar int_adapter types. The return type will match that of the the calling object's type

int_adapter operator-(const int_type rhs) const;

int_adapter operator *(const int_adapter & rhs) const;

int_adapter operator *(const int rhs) const;

Provided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results.

int_adapter operator/(const int_adapter & rhs) const;

int_adapter operator/(const int rhs) const;

Provided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results.

int_adapter operator%(const int_adapter & rhs) const;

int_adapter operator%(const int rhs) const;

Provided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results.

int_adapter public static functions

bool has_infinity() ;

const int_adapter pos_infinity() ;

const int_adapter neg_infinity() ;

const int_adapter not_a_number() ;

int_adapter max BOOST_PREVENT_MACRO_SUBSTITUTION() ;

int_adapter min BOOST_PREVENT_MACRO_SUBSTITUTION() ;

int_adapter from_special(special_values sv) ;

bool is_inf(int_type v) ;

bool is_neg_inf(int_type v) ;

bool is_pos_inf(int_type v) ;

bool is_not_a_number(int_type v) ;

special_values to_special(int_type v) ;

Returns either special value type or is_not_special.

int_type maxcount() ;

int_adapter private member functions

int compare(const int_adapter & rhs) const;

returns -1, 0, 1, or 2 if 'this' is <, ==, >, or 'nan comparison' rhs

int_adapter mult_div_specials(const int_adapter & rhs) const;

Assumes at least 'this' or 'rhs' is a special value.

int_adapter mult_div_specials(const int & rhs) const;

Assumes 'this' is a special value.
boost::date_time::operator<<

template<typename charT, typename traits, typename int_type> 
  std::basic_ostream< charT, traits > & 
  operator<<(std::basic_ostream< charT, traits > & os, 
             const int_adapter< int_type > & ia);

Description
Expected output is either a numeric representation or a special values representation. Ex. "12", "+infinity", "not-a-number", etc.

Header <boost/date_time/iso_format.hpp>

namespace boost {
  namespace date_time {
    template<typename charT> class iso_format_base;

    template<> class iso_format_base<wchar_t>;

    template<typename charT> class iso_format;
    template<typename charT> class iso_extended_format;
  }
}

boost::date_time::iso_format_base
Class to provide common iso formatting spec.

template<typename charT> 
class iso_format_base {
public:

  // public static functions
  month_format_spec month_format() ;
  const charT * not_a_date() ;
  const charT * pos_infinity() ;
  const charT * neg_infinity() ;
  charT year_sep_char() ;
  charT month_sep_char() ;
  charT day_sep_char() ;
  charT hour_sep_char() ;
  charT minute_sep_char() ;
  charT second_sep_char() ;
  charT period_start_char() ;
  charT time_start_char() ;
  charT week_start_char() ;
  charT period_sep_char() ;
  charT time_sep_char() ;
  charT fractional_time_sep_char() ;
  bool is_component_sep(charT) ;
  bool is_fractional_time_sep(charT) ;
  bool is_timezone_sep(charT) ;
  charT element_sep_char() ;
};

Description

iso_format_base public static functions

month_format_spec month_format() ;

Describe month format -- its an integer in iso format.

const charT * not_a_date() ;

String used printed is date is invalid.

const charT * pos_infinity() ;

String used to for positive infinity value.

const charT * neg_infinity() ;

String used to for positive infinity value.

charT year_sep_char() ;

ISO char for a year -- used in durations.

charT month_sep_char() ;

ISO char for a month.

charT day_sep_char() ;

ISO char for a day.

charT hour_sep_char() ;

char for minute

charT minute_sep_char() ;

char for minute

charT second_sep_char() ;

char for second

charT period_start_char() ;

ISO char for a period.

charT time_start_char() ;

Used in time in mixed strings to set start of time.

charT week_start_char() ;

Used in mixed strings to identify start of a week number.

charT period_sep_char() ;

Separators for periods.

charT time_sep_char() ;

Separator for hh:mm:ss.

charT fractional_time_sep_char() ;

Preferred Separator for hh:mm:ss,decimal_fraction.

bool is_component_sep(charT sep) ;

bool is_fractional_time_sep(charT sep) ;

bool is_timezone_sep(charT sep) ;

charT element_sep_char() ;

Specializations
Class iso_format_base<wchar_t>
boost::date_time::iso_format_base<wchar_t>
Class to provide common iso formatting spec.

class iso_format_base<wchar_t> {
public:

  // public static functions
  month_format_spec month_format() ;
  const wchar_t * not_a_date() ;
  const wchar_t * pos_infinity() ;
  const wchar_t * neg_infinity() ;
  wchar_t year_sep_char() ;
  wchar_t month_sep_char() ;
  wchar_t day_sep_char() ;
  wchar_t hour_sep_char() ;
  wchar_t minute_sep_char() ;
  wchar_t second_sep_char() ;
  wchar_t period_start_char() ;
  wchar_t time_start_char() ;
  wchar_t week_start_char() ;
  wchar_t period_sep_char() ;
  wchar_t time_sep_char() ;
  wchar_t fractional_time_sep_char() ;
  bool is_component_sep(wchar_t) ;
  bool is_fractional_time_sep(wchar_t) ;
  bool is_timezone_sep(wchar_t) ;
  wchar_t element_sep_char() ;
};

Description

iso_format_base public static functions

month_format_spec month_format() ;

Describe month format -- its an integer in iso format.

const wchar_t * not_a_date() ;

String used printed is date is invalid.

const wchar_t * pos_infinity() ;

String used to for positive infinity value.

const wchar_t * neg_infinity() ;

String used to for positive infinity value.

wchar_t year_sep_char() ;

ISO char for a year -- used in durations.

wchar_t month_sep_char() ;

ISO char for a month.

wchar_t day_sep_char() ;

ISO char for a day.

wchar_t hour_sep_char() ;

char for minute

wchar_t minute_sep_char() ;

char for minute

wchar_t second_sep_char() ;

char for second

wchar_t period_start_char() ;

ISO char for a period.

wchar_t time_start_char() ;

Used in time in mixed strings to set start of time.

wchar_t week_start_char() ;

Used in mixed strings to identify start of a week number.

wchar_t period_sep_char() ;

Separators for periods.

wchar_t time_sep_char() ;

Separator for hh:mm:ss.

wchar_t fractional_time_sep_char() ;

Preferred Separator for hh:mm:ss,decimal_fraction.

bool is_component_sep(wchar_t sep) ;

bool is_fractional_time_sep(wchar_t sep) ;

bool is_timezone_sep(wchar_t sep) ;

wchar_t element_sep_char() ;

boost::date_time::iso_format
Format description for iso normal YYYYMMDD.

template<typename charT> 
class iso_format : public boost::date_time::iso_format_base< charT > {
public:

  // public static functions
  bool has_date_sep_chars() ;
};

Description

iso_format public static functions

bool has_date_sep_chars() ;

The ios standard format doesn't use char separators.
boost::date_time::iso_extended_format
Extended format uses seperators YYYY-MM-DD.

template<typename charT> 
class iso_extended_format
  :  : public boost::date_time::iso_format_base< charT >
{
public:

  // public static functions
  bool has_date_sep_chars() ;
};

Description

iso_extended_format public static functions

bool has_date_sep_chars() ;

Extended format needs char separators.

Header <boost/date_time/local_time_adjustor.hpp>
Time adjustment calculations for local times

namespace boost {
  namespace date_time {
    template<typename time_duration_type, short hours, 
             unsigned short minutes = > 
      class utc_adjustment;
    template<typename time_type, typename dst_rules> 
      class dynamic_local_time_adjustor;
    template<typename time_type, typename dst_rules, 
             typename utc_offset_rules> 
      class static_local_time_adjustor;
    template<typename time_type, short utc_offset, typename dst_rule> 
      class local_adjustor;
    void dummy_to_prevent_msvc6_ice();
  }
}

boost::date_time::utc_adjustment
Provides a base offset adjustment from utc.

template<typename time_duration_type, short hours, unsigned short minutes = > 
class utc_adjustment {
public:

  // public static functions
  time_duration_type local_to_utc_base_offset() ;
  time_duration_type utc_to_local_base_offset() ;
};

Description

utc_adjustment public static functions

time_duration_type local_to_utc_base_offset() ;

time_duration_type utc_to_local_base_offset() ;

boost::date_time::dynamic_local_time_adjustor
Allow sliding utc adjustment with fixed dst rules.

template<typename time_type, typename dst_rules> 
class dynamic_local_time_adjustor {
public:
  // types
  typedef time_type::time_duration_type time_duration_type;
  typedef time_type::date_type          date_type;         

  // construct/copy/destruct
  dynamic_local_time_adjustor(time_duration_type);

  // public member functions
  time_duration_type utc_offset(bool) ;
};

Description

dynamic_local_time_adjustor construct/copy/destruct

dynamic_local_time_adjustor(time_duration_type utc_offset);

dynamic_local_time_adjustor public member functions

time_duration_type utc_offset(bool is_dst) ;

Presumes local time.
boost::date_time::static_local_time_adjustor
Embed the rules for local time adjustments at compile time.

template<typename time_type, typename dst_rules, typename utc_offset_rules> 
class static_local_time_adjustor {
public:
  // types
  typedef time_type::time_duration_type time_duration_type;
  typedef time_type::date_type          date_type;         

  // public static functions
  time_duration_type utc_to_local_offset(const time_type &) ;
  time_duration_type 
  local_to_utc_offset(const time_type &, 
                      date_time::dst_flags = date_time::calculate) ;
};

Description

static_local_time_adjustor public static functions

time_duration_type utc_to_local_offset(const time_type & t) ;

Calculates the offset from a utc time to local based on dst and utc offset.
The logic is as follows. Starting with UTC time use the offset to create a label for an non-dst adjusted local time. Then call dst_rules::local_is_dst with the non adjust local time. The results of this function will either unabiguously decide that the initial local time is in dst or return an illegal or ambiguous result. An illegal result only occurs at the end of dst (where labels are skipped) and indicates that dst has ended. An ambiguous result means that we need to recheck by making a dst adjustment and then rechecking. If the dst offset is added to the utc time and the recheck proves non-ambiguous then we are past the boundary. If it is still ambiguous then we are ahead of the boundary and dst is still in effect.
TODO -- check if all dst offsets are positive. If not then the algorithm needs to check for this and reverse the illegal/ambiguous logic.

Parameters
t	UTC time to calculate offset to local time This adjustment depends on the following observations about the workings of the DST boundary offset. Since UTC time labels are monotonically increasing we can determine if a given local time is in DST or not and therefore adjust the offset appropriately.

time_duration_type 
local_to_utc_offset(const time_type & t, 
                    date_time::dst_flags dst = date_time::calculate) ;

Get the offset to UTC given a local time.
boost::date_time::local_adjustor
Template that simplifies the creation of local time calculator.

template<typename time_type, short utc_offset, typename dst_rule> 
class local_adjustor {
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;      

  // public static functions
  time_type utc_to_local(const time_type &) ;
  time_type local_to_utc(const time_type &, 
                         date_time::dst_flags = date_time::calculate) ;
};

Description
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;

local_adjustor public static functions

time_type utc_to_local(const time_type & t) ;

Convert a utc time to local time.

time_type local_to_utc(const time_type & t, 
                       date_time::dst_flags dst = date_time::calculate) ;

Convert a local time to utc.

Header <boost/date_time/local_timezone_defs.hpp>

namespace boost {
  namespace date_time {
    template<typename date_type> struct us_dst_trait;
    template<typename date_type> struct eu_dst_trait;
    template<typename date_type> struct uk_dst_trait;
    template<typename date_type> struct acst_dst_trait;
  }
}

boost::date_time::us_dst_trait
Specification for daylight savings start rules in US.

template<typename date_type> 
struct us_dst_trait {
  // types
  typedef date_type::day_of_week_type                 day_of_week_type;  
  typedef date_type::month_type                       month_type;        
  typedef date_time::first_kday_of_month< date_type > start_rule_functor;
  typedef date_time::last_kday_of_month< date_type >  end_rule_functor;  

  // public static functions
  day_of_week_type start_day() ;
  month_type start_month() ;
  day_of_week_type end_day() ;
  month_type end_month() ;
  int dst_start_offset_minutes() ;
  int dst_end_offset_minutes() ;
  int dst_shift_length_minutes() ;
};

Description
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;
          typedef boost::date_time::dst_calc_engine<date, time_duration, 
                                                    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()) 
              == boost::date_time::is_not_in_dst) 
          {

          }

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.

us_dst_trait public static functions

day_of_week_type start_day() ;

month_type start_month() ;

day_of_week_type end_day() ;

month_type end_month() ;

int dst_start_offset_minutes() ;

int dst_end_offset_minutes() ;

int dst_shift_length_minutes() ;

boost::date_time::eu_dst_trait
Rules for daylight savings start in the EU (Last Sun in Mar).

template<typename date_type> 
struct eu_dst_trait {
  // types
  typedef date_type::day_of_week_type                day_of_week_type;  
  typedef date_type::month_type                      month_type;        
  typedef date_time::last_kday_of_month< date_type > start_rule_functor;
  typedef date_time::last_kday_of_month< date_type > end_rule_functor;  

  // public static functions
  day_of_week_type start_day() ;
  month_type start_month() ;
  day_of_week_type end_day() ;
  month_type end_month() ;
  int dst_start_offset_minutes() ;
  int dst_end_offset_minutes() ;
  int dst_shift_length_minutes() ;
};

Description
These amount to the following:
Start of dst day is last Sunday in March
End day of dst is last Sunday in Oct
Going forward switch time is 2:00 am (offset 120 minutes)
Going back switch time is 3:00 am (off set 180 minutes)
Shift duration is one hour (60 minutes)

eu_dst_trait public static functions

day_of_week_type start_day() ;

month_type start_month() ;

day_of_week_type end_day() ;

month_type end_month() ;

int dst_start_offset_minutes() ;

int dst_end_offset_minutes() ;

int dst_shift_length_minutes() ;

boost::date_time::uk_dst_trait
Alternative dst traits for some parts of the United Kingdom.

template<typename date_type> 
struct uk_dst_trait : public boost::date_time::eu_dst_trait< date_type > {

  // public static functions
  int dst_start_offset_minutes() ;
  int dst_end_offset_minutes() ;
  int dst_shift_length_minutes() ;
};

Description

uk_dst_trait public static functions

int dst_start_offset_minutes() ;

int dst_end_offset_minutes() ;

int dst_shift_length_minutes() ;

boost::date_time::acst_dst_trait

template<typename date_type> 
struct acst_dst_trait {
  // types
  typedef date_type::day_of_week_type                day_of_week_type;  
  typedef date_type::month_type                      month_type;        
  typedef date_time::last_kday_of_month< date_type > start_rule_functor;
  typedef date_time::last_kday_of_month< date_type > end_rule_functor;  

  // public static functions
  day_of_week_type start_day() ;
  month_type start_month() ;
  day_of_week_type end_day() ;
  month_type end_month() ;
  int dst_start_offset_minutes() ;
  int dst_end_offset_minutes() ;
  int dst_shift_length_minutes() ;
};

Description

acst_dst_trait public static functions

day_of_week_type start_day() ;

month_type start_month() ;

day_of_week_type end_day() ;

month_type end_month() ;

int dst_start_offset_minutes() ;

int dst_end_offset_minutes() ;

int dst_shift_length_minutes() ;

Header <boost/date_time/microsec_time_clock.hpp>
This file contains a high resolution time clock implementation.

namespace boost {
  namespace date_time {
    template<typename time_type> class microsec_clock;
  }
}

boost::date_time::microsec_clock
A clock providing microsecond level resolution.

template<typename time_type> 
class microsec_clock {
public:
  // types
  typedef time_type::date_type          date_type;             
  typedef time_type::time_duration_type time_duration_type;    
  typedef time_duration_type::rep_type  resolution_traits_type;

  // public static functions
  time_type local_time() ;

  // private static functions
  time_type create_time(timeval *) ;
  time_type local_time() ;
  time_type create_time(FILETIME &) ;
};

Description
A high precision clock that measures the local time at a resolution up to microseconds and adjusts to the resolution of the time system. For example, for the a library configuration with nano second resolution, the last 3 places of the fractional seconds will always be 000 since there are 1000 nano-seconds in a micro second.

microsec_clock public static functions

time_type local_time() ;

Return the local time based on computer clock settings.

microsec_clock private static functions

time_type create_time(timeval * tv) ;

time_type local_time() ;

Return the local time based on computer clock settings.

time_type create_time(FILETIME & ft) ;

Header <boost/date_time/parse_format_base.hpp>

namespace boost {
  namespace date_time {

    // Enum for distinguishing parsing and formatting options. 
    enum month_format_spec { month_as_integer, month_as_short_string, 
                             month_as_long_string };
    enum ymd_order_spec;
  }
}

boost::date_time::ymd_order_spec
Enum for distinguishing the order of Month, Day, & Year.


enum ymd_order_spec { ymd_order_iso, ymd_order_dmy, ymd_order_us };

Header <boost/date_time/period.hpp>
This file contain the implementation of the period abstraction. This is basically the same idea as a range. Although this class is intended for use in the time library, it is pretty close to general enough for other numeric uses.

namespace boost {
  namespace date_time {
    template<typename point_rep, typename duration_rep> class period;
  }
}

boost::date_time::period
Provides generalized period type useful in date-time systems.

template<typename point_rep, typename duration_rep> 
class period {
public:
  // types
  typedef point_rep    point_type;   
  typedef duration_rep duration_type;

  // construct/copy/destruct
  period(point_rep, point_rep);
  period(point_rep, duration_rep);

  // public member functions
  point_rep begin() const;
  point_rep end() const;
  point_rep last() const;
  duration_rep length() const;
  bool is_null() const;
  bool operator==(const period &) const;
  bool operator<(const period &) const;
  void shift(const duration_rep &) ;
  bool contains(const point_rep &) const;
  bool contains(const period &) const;
  bool intersects(const period &) const;
  bool is_adjacent(const period &) const;
  bool is_before(const point_rep &) const;
  bool is_after(const point_rep &) const;
  period intersection(const period &) const;
  period merge(const period &) const;
  period span(const period &) const;
};

Description
This template uses a class to represent a time point within the period and another class to represent a duration. As a result, this class is not appropriate for use when the number and duration representation are the same (eg: in the regular number domain).
A period can be specified by providing either the starting point and a duration or the starting point and the end point( end is NOT part of the period but 1 unit past it. A period will be "invalid" if either start_point >= end_point or the given duration is < 0. Any valid period will return false for is_null().
Zero length periods are considered valid. In this case the start point is exactly 1 unit less than the end point, in other words start is equal to last.
In the case that the begin and last are the same, the period has a length of zero units. For example, suppose this is a period of days. That is, each time-point represents a single day. If the start and the last is the same day then the period is zero length.
The best way to handle periods is usually to provide a start point and a duration. So, day1 + 7 days is a week period which includes all of the first day and 6 more days (eg: Sun to Sat).

period construct/copy/destruct

period(point_rep first_point, point_rep end_point);

create a period from begin to last eg: [begin,end)
If end <= begin then the period will be invalid

period(point_rep first_point, duration_rep len);

create a period as [begin, begin+len)
If len is < 0 then the period will be invalid

period public member functions

point_rep begin() const;

Return the first element in the period.

point_rep end() const;

Return one past the last element.

point_rep last() const;

Return the last item in the period.

duration_rep length() const;

Return the length of the period.

bool is_null() const;

True if period is ill formed (length less than zero).

bool operator==(const period & rhs) const;

Equality operator.

bool operator<(const period & rhs) const;

Strict as defined by rhs.last <= lhs.last.

void shift(const duration_rep & d) ;

Shift the start and end by the specified amount.

bool contains(const point_rep & point) const;

True if the point is inside the period.

bool contains(const period & other) const;

True if this period fully contains (or equals) the other period.

bool intersects(const period & other) const;

True if the periods overlap in any way.

bool is_adjacent(const period & other) const;

True if periods are next to each other without a gap.

bool is_before(const point_rep & point) const;

True if all of the period is prior to the passed point or end <= t.

bool is_after(const point_rep & point) const;

True if all of the period is prior or t < start.

period intersection(const period & other) const;

Returns the period of intersection or invalid range no intersection.

period merge(const period & other) const;

Returns the union of intersecting periods -- or null period.

period span(const period & other) const;

Combine two periods with earliest start and latest end.
Combines two periods and any gap between them such that start = min(p1.start, p2.start) end = max(p1.end , p2.end)

        [---p1---)
                       [---p2---)
 result:
        [-----------p3----------) 
   *

Header <boost/date_time/special_defs.hpp>

namespace boost {
  namespace date_time {

    enum special_values { not_a_date_time, neg_infin, pos_infin, 
                          min_date_time, max_date_time, not_special, 
                          NumSpecialValues };
  }
}

Header <boost/date_time/time.hpp>
This file contains the interface for the time associated classes.

namespace boost {
  namespace date_time {
    template<typename T, typename time_system> class base_time;
  }
}

boost::date_time::base_time
Representation of a precise moment in time, including the date.

template<typename T, typename time_system> 
class base_time {
public:
  // types
  typedef T                               time_type;         
  typedef time_system::time_rep_type      time_rep_type;     
  typedef time_system::date_type          date_type;         
  typedef time_system::date_duration_type date_duration_type;
  typedef time_system::time_duration_type time_duration_type;

  // construct/copy/destruct
  base_time(const date_type &, const time_duration_type &, 
            dst_flags = not_dst);
  base_time(const time_rep_type &);

  // public member functions
  date_type date() const;
  time_duration_type time_of_day() const;
  std::string zone_name() const;
  bool is_not_a_date_time() const;
  bool is_infinity() const;
  bool is_pos_infinity() const;
  bool is_neg_infinity() const;
  bool operator==(const time_type &) const;
  bool operator<(const time_type &) const;
  time_duration_type operator-(const time_type &) const;
  time_type operator+(const date_duration_type &) const;
  time_type operator+=(const date_duration_type &) ;
  time_type operator-(const date_duration_type &) const;
  time_type operator-=(const date_duration_type &) ;
  time_type operator+(const time_duration_type &) const;
  time_type operator+=(const time_duration_type &) ;
  time_type operator-(const time_duration_type &) const;
  time_type operator-=(const time_duration_type &) ;
};

Description
This class is a skeleton for the interface of a temporal type with a resolution that is higher than a day. It is intended that this class be the base class and that the actual time class be derived using the BN pattern. In this way, the derived class can make decisions such as 'should there be a default constructor' and what should it set its value to, should there be optional constructors say allowing only an time_durations that generate a time from a clock,etc. So, in fact multiple time types can be created for a time_system with different construction policies, and all of them can perform basic operations by only writing a copy constructor. Finally, compiler errors are also shorter.
The real behavior of the time class is provided by the time_system template parameter. This class must provide all the logic for addition, subtraction, as well as define all the interface types.

base_time construct/copy/destruct

base_time(const date_type & day, const time_duration_type & td, 
          dst_flags dst = not_dst);

base_time(const time_rep_type & rhs);

base_time public member functions

date_type date() const;

time_duration_type time_of_day() const;

std::string zone_name() const;

bool is_not_a_date_time() const;

check to see if date is not a value

bool is_infinity() const;

check to see if date is one of the infinity values

bool is_pos_infinity() const;

check to see if date is greater than all possible dates

bool is_neg_infinity() const;

check to see if date is greater than all possible dates

bool operator==(const time_type & rhs) const;

Equality operator -- others generated by boost::equality_comparable.

bool operator<(const time_type & rhs) const;

Equality operator -- others generated by boost::less_than_comparable.

time_duration_type operator-(const time_type & rhs) const;

difference between two times

time_type operator+(const date_duration_type & dd) const;

add date durations

time_type operator+=(const date_duration_type & dd) ;

time_type operator-(const date_duration_type & dd) const;

subtract date durations

time_type operator-=(const date_duration_type & dd) ;

time_type operator+(const time_duration_type & td) const;

add time durations

time_type operator+=(const time_duration_type & td) ;

time_type operator-(const time_duration_type & rhs) const;

subtract time durations

time_type operator-=(const time_duration_type & td) ;

Header <boost/date_time/time_clock.hpp>
This file contains the interface for clock devices.

namespace boost {
  namespace date_time {
    template<typename date_type, typename time_type> class second_clock;
  }
}

boost::date_time::second_clock
A clock providing time level services based on C time_t capabilities.

template<typename date_type, typename time_type> 
class second_clock {
public:
  // types
  typedef time_type::time_duration_type time_duration_type;

  // public static functions
  time_type local_time() ;
  time_type universal_time() ;

  // private static functions
  time_type create_time(::std::tm *) ;
};

Description
This clock provides resolution to the 1 second level

second_clock public static functions

time_type local_time() ;

time_type universal_time() ;

Get the current day in universal date as a ymd_type.

second_clock private static functions

time_type create_time(::std::tm * current) ;

Header <boost/date_time/time_defs.hpp>
This file contains nice definitions for handling the resoluion of various time reprsentations.

namespace boost {
  namespace date_time {

    // Defines some nice types for handling time level resolutions. 
    enum time_resolutions { sec, tenth, hundreth, milli, ten_thousandth, 
                            micro, nano, NumResolutions };

    // Flags for daylight savings or summer time. 
    enum dst_flags { not_dst, is_dst, calculate };
  }
}

Header <boost/date_time/time_duration.hpp>

namespace boost {
  namespace date_time {
    template<typename T, typename rep_type> class time_duration;
    template<typename base_duration, long frac_of_second> 
      class subsecond_duration;
  }
}

boost::date_time::time_duration
Represents some amount of elapsed time measure to a given resolution.

template<typename T, typename rep_type> 
class time_duration {
public:
  // types
  typedef T                                 duration_type;          
  typedef rep_type                          traits_type;            
  typedef rep_type::day_type                day_type;               
  typedef rep_type::hour_type               hour_type;              
  typedef rep_type::min_type                min_type;               
  typedef rep_type::sec_type                sec_type;               
  typedef rep_type::fractional_seconds_type fractional_seconds_type;
  typedef rep_type::tick_type               tick_type;              
  typedef rep_type::impl_type               impl_type;              

  // construct/copy/destruct
  time_duration();
  time_duration(hour_type, min_type, sec_type = 0, 
                fractional_seconds_type = 0);
  time_duration(const time_duration< T, rep_type > &);
  time_duration(special_values);
  time_duration(impl_type);

  // public member functions
  hour_type hours() const;
  min_type minutes() const;
  sec_type seconds() const;
  sec_type total_seconds() const;
  tick_type total_milliseconds() const;
  tick_type total_nanoseconds() const;
  tick_type total_microseconds() const;
  fractional_seconds_type fractional_seconds() const;
  duration_type invert_sign() const;
  bool is_negative() const;
  bool operator<(const time_duration &) const;
  bool operator==(const time_duration &) const;
  duration_type operator-() const;
  duration_type operator-(const duration_type &) const;
  duration_type operator+(const duration_type &) const;
  duration_type operator/(int) ;
  duration_type operator-=(const duration_type &) ;
  duration_type operator+=(const duration_type &) ;
  duration_type operator/=(int) ;
  duration_type operator *(int) const;
  duration_type operator *=(int) ;
  tick_type ticks() const;
  bool is_special() const;
  bool is_pos_infinity() const;
  bool is_neg_infinity() const;
  bool is_not_a_date_time() const;
  impl_type get_rep() const;

  // public static functions
  duration_type unit() ;
  tick_type ticks_per_second() ;
  time_resolutions resolution() ;
  unsigned short num_fractional_digits() ;

  // protected member functions
};

Description
This class represents a standard set of capabilities for all counted time durations. Time duration implementations should derive from this class passing their type as the first template parameter. This design allows the subclass duration types to provide custom construction policies or other custom features not provided here.

time_duration construct/copy/destruct

time_duration();

time_duration(hour_type hours, min_type minutes, sec_type seconds = 0, 
              fractional_seconds_type frac_sec = 0);

time_duration(const time_duration< T, rep_type > & other);

Construct from another time_duration (Copy constructor).

time_duration(special_values sv);

Construct from special_values.

time_duration(impl_type in);

time_duration public member functions

hour_type hours() const;

Returns number of hours in the duration.

min_type minutes() const;

Returns normalized number of minutes.

sec_type seconds() const;

Returns normalized number of seconds (0..60).

sec_type total_seconds() const;

Returns total number of seconds truncating any fractional seconds.

tick_type total_milliseconds() const;

Returns total number of milliseconds truncating any fractional seconds.

tick_type total_nanoseconds() const;

Returns total number of nanoseconds truncating any sub millisecond values.

tick_type total_microseconds() const;

Returns total number of microseconds truncating any sub microsecond values.

fractional_seconds_type fractional_seconds() const;

Returns count of fractional seconds at given resolution.

duration_type invert_sign() const;

bool is_negative() const;

bool operator<(const time_duration & rhs) const;

bool operator==(const time_duration & rhs) const;

duration_type operator-() const;

unary- Allows for time_duration td = -td1

duration_type operator-(const duration_type & d) const;

duration_type operator+(const duration_type & d) const;

duration_type operator/(int divisor) ;

duration_type operator-=(const duration_type & d) ;

duration_type operator+=(const duration_type & d) ;

duration_type operator/=(int divisor) ;

Division operations on a duration with an integer.

duration_type operator *(int rhs) const;

Multiplication operations an a duration with an integer.

duration_type operator *=(int divisor) ;

tick_type ticks() const;

bool is_special() const;

Is ticks_ a special value?

bool is_pos_infinity() const;

Is duration pos-infinity.

bool is_neg_infinity() const;

Is duration neg-infinity.

bool is_not_a_date_time() const;

Is duration not-a-date-time.

impl_type get_rep() const;

Used for special_values output.

time_duration public static functions

duration_type unit() ;

Returns smallest representable duration.

tick_type ticks_per_second() ;

Return the number of ticks in a second.

time_resolutions resolution() ;

Provide the resolution of this duration type.

unsigned short num_fractional_digits() ;

Returns number of possible digits in fractional seconds.

time_duration protected member functions
boost::date_time::subsecond_duration
Template for instantiating derived adjusting durations.

template<typename base_duration, long frac_of_second> 
class subsecond_duration {
public:
  // types
  typedef base_duration::traits_type traits_type;

  // construct/copy/destruct
  subsecond_duration(long);

  // public member functions
};

Description

subsecond_duration construct/copy/destruct

subsecond_duration(long ss);

subsecond_duration public member functions

Header <boost/date_time/time_formatting_streams.hpp>

namespace boost {
  namespace date_time {
    template<typename time_duration_type, typename charT = char> 
      class ostream_time_duration_formatter;
    template<typename time_type, typename charT = char> 
      class ostream_time_formatter;
    template<typename time_period_type, typename charT = char> 
      class ostream_time_period_formatter;
  }
}

boost::date_time::ostream_time_duration_formatter
Put a time type into a stream using appropriate facets.

template<typename time_duration_type, typename charT = char> 
class ostream_time_duration_formatter {
public:
  // types
  typedef std::basic_ostream< charT >                 ostream_type;           
  typedef time_duration_type::fractional_seconds_type fractional_seconds_type;

  // public static functions
  void duration_put(const time_duration_type &, ostream_type &) ;
};

Description

ostream_time_duration_formatter public static functions

void duration_put(const time_duration_type & td, ostream_type & os) ;

Put time into an ostream.
boost::date_time::ostream_time_formatter
Put a time type into a stream using appropriate facets.

template<typename time_type, typename charT = char> 
class ostream_time_formatter {
public:
  // types
  typedef std::basic_ostream< charT >                                  ostream_type;      
  typedef time_type::date_type                                         date_type;         
  typedef time_type::time_duration_type                                time_duration_type;
  typedef ostream_time_duration_formatter< time_duration_type, charT > duration_formatter;

  // public static functions
  void time_put(const time_type &, ostream_type &) ;
};

Description

ostream_time_formatter public static functions

void time_put(const time_type & t, ostream_type & os) ;

Put time into an ostream.
boost::date_time::ostream_time_period_formatter
Put a time period into a stream using appropriate facets.

template<typename time_period_type, typename charT = char> 
class ostream_time_period_formatter {
public:
  // types
  typedef std::basic_ostream< charT >                ostream_type;  
  typedef time_period_type::point_type               time_type;     
  typedef ostream_time_formatter< time_type, charT > time_formatter;

  // public static functions
  void period_put(const time_period_type &, ostream_type &) ;
};

Description

ostream_time_period_formatter public static functions

void period_put(const time_period_type & tp, ostream_type & os) ;

Put time into an ostream.

Header <boost/date_time/time_iterator.hpp>

namespace boost {
  namespace date_time {
    template<typename time_type> class time_itr;
  }
}

boost::date_time::time_itr
Simple time iterator skeleton class.

template<typename time_type> 
class time_itr {
public:
  // types
  typedef time_type::time_duration_type time_duration_type;

  // construct/copy/destruct
  time_itr(time_type, time_duration_type);

  // public member functions
  time_itr & operator++() ;
  time_itr & operator--() ;
  time_type operator *() ;
  time_type * operator->() ;
  bool operator<(const time_type &) ;
  bool operator<=(const time_type &) ;
  bool operator!=(const time_type &) ;
  bool operator==(const time_type &) ;
  bool operator>(const time_type &) ;
  bool operator>=(const time_type &) ;
};

Description

time_itr construct/copy/destruct

time_itr(time_type t, time_duration_type d);

time_itr public member functions

time_itr & operator++() ;

time_itr & operator--() ;

time_type operator *() ;

time_type * operator->() ;

bool operator<(const time_type & t) ;

bool operator<=(const time_type & t) ;

bool operator!=(const time_type & t) ;

bool operator==(const time_type & t) ;

bool operator>(const time_type & t) ;

bool operator>=(const time_type & t) ;

Header <boost/date_time/time_parsing.hpp>

namespace boost {
  namespace date_time {
    template<typename time_duration> 
      time_duration parse_delimited_time_duration(const std::string &);

    // Utility function to split appart string. 
    bool split(const std::string & s, char sep, std::string & first, 
               std::string & second);
    template<typename time_type> 
      time_type parse_delimited_time(const std::string & s, char sep);

    // Parse time duration part of an iso time of form: [-]hhmmss (eg: 120259 is 12 hours 2 min 59 seconds). 
    template<typename time_duration> 
      time_duration parse_undelimited_time_duration(const std::string & s);

    // Parse time string of form YYYYMMDDThhmmss where T is delimeter between date and time. 
    template<typename time_type> 
      time_type parse_iso_time(const std::string & s, char sep);
  }
}

boost::date_time::parse_delimited_time_duration
Creates a time_duration object from a delimited string.

template<typename time_duration> 
  time_duration parse_delimited_time_duration(const std::string & s);

Description
Expected format for string is "[-]h[h][:mm][:ss][.fff]". A negative duration will be created if the first character in string is a '-', all other '-' will be treated as delimiters. Accepted delimiters are "-:,.".

Header <boost/date_time/time_resolution_traits.hpp>

namespace boost {
  namespace date_time {
    struct time_resolution_traits_bi32_impl;
    struct time_resolution_traits_adapted32_impl;
    struct time_resolution_traits_bi64_impl;
    struct time_resolution_traits_adapted64_impl;

    template<typename frac_sec_type, time_resolutions res, 
             #if(defined(BOOST_MSVC)&&(_MSC_VER<=1200)) boost::int64_t resolution_adjust, 
             #else typename frac_sec_type::int_type resolution_adjust, 
             #endif unsigned short frac_digits, 
             typename v_type = boost::int32_t> 
      class time_resolution_traits;

    typedef time_resolution_traits< time_resolution_traits_adapted32_impl, milli, 1000, 3 > milli_res;
    typedef time_resolution_traits< time_resolution_traits_adapted64_impl, micro, 1000000, 6 > micro_res;
    typedef time_resolution_traits< time_resolution_traits_adapted64_impl, nano, 1000000000, 9 > nano_res;

    // Simple function to calculate absolute value of a numeric type. 
    template<typename T> T absolute_value(T x);
  }
}

boost::date_time::time_resolution_traits_bi32_impl
traits struct for time_resolution_traits implementation type

struct time_resolution_traits_bi32_impl {
  // types
  typedef boost::int32_t int_type; 
  typedef boost::int32_t impl_type;

  // public static functions
  int_type as_number(impl_type) ;
  bool is_adapted() ;
};

Description

time_resolution_traits_bi32_impl public static functions

int_type as_number(impl_type i) ;

bool is_adapted() ;

Used to determine if implemented type is int_adapter or int.
boost::date_time::time_resolution_traits_adapted32_impl
traits struct for time_resolution_traits implementation type

struct time_resolution_traits_adapted32_impl {
  // types
  typedef boost::int32_t                                  int_type; 
  typedef boost::date_time::int_adapter< boost::int32_t > impl_type;

  // public static functions
  int_type as_number(impl_type) ;
  bool is_adapted() ;
};

Description

time_resolution_traits_adapted32_impl public static functions

int_type as_number(impl_type i) ;

bool is_adapted() ;

Used to determine if implemented type is int_adapter or int.
boost::date_time::time_resolution_traits_bi64_impl
traits struct for time_resolution_traits implementation type

struct time_resolution_traits_bi64_impl {
  // types
  typedef boost::int64_t int_type; 
  typedef boost::int64_t impl_type;

  // public static functions
  int_type as_number(impl_type) ;
  bool is_adapted() ;
};

Description

time_resolution_traits_bi64_impl public static functions

int_type as_number(impl_type i) ;

bool is_adapted() ;

Used to determine if implemented type is int_adapter or int.
boost::date_time::time_resolution_traits_adapted64_impl
traits struct for time_resolution_traits implementation type

struct time_resolution_traits_adapted64_impl {
  // types
  typedef boost::int64_t                                  int_type; 
  typedef boost::date_time::int_adapter< boost::int64_t > impl_type;

  // public static functions
  int_type as_number(impl_type) ;
  bool is_adapted() ;
};

Description

time_resolution_traits_adapted64_impl public static functions

int_type as_number(impl_type i) ;

bool is_adapted() ;

Used to determine if implemented type is int_adapter or int.
boost::date_time::time_resolution_traits

template<typename frac_sec_type, time_resolutions res, 
         #if(defined(BOOST_MSVC)&&(_MSC_VER<=1200)) boost::int64_t resolution_adjust, 
         #else typename frac_sec_type::int_type resolution_adjust, 
         #endif unsigned short frac_digits, typename v_type = boost::int32_t> 
class time_resolution_traits {
public:
  // types
  typedef frac_sec_type::int_type  fractional_seconds_type;
  typedef frac_sec_type::int_type  tick_type;              
  typedef frac_sec_type::impl_type impl_type;              
  typedef v_type                   day_type;               
  typedef v_type                   hour_type;              
  typedef v_type                   min_type;               
  typedef v_type                   sec_type;               

  // public member functions
   BOOST_STATIC_CONSTANT(int, ticks_per_second = resolution_adjust) ;

  // public static functions
  frac_sec_type::int_type as_number(typename frac_sec_type::impl_type) ;
  bool is_adapted() ;
  time_resolutions resolution() ;
  unsigned short num_fractional_digits() ;
  fractional_seconds_type res_adjust() ;
  tick_type to_tick_count(hour_type, min_type, sec_type, 
                          fractional_seconds_type) ;
};

Description

time_resolution_traits public member functions

 BOOST_STATIC_CONSTANT(int , ticks_per_second  = resolution_adjust) ;

time_resolution_traits public static functions

frac_sec_type::int_type as_number(typename frac_sec_type::impl_type i) ;

bool is_adapted() ;

time_resolutions resolution() ;

unsigned short num_fractional_digits() ;

fractional_seconds_type res_adjust() ;

tick_type to_tick_count(hour_type hours, min_type minutes, sec_type seconds, 
                        fractional_seconds_type fs) ;

Any negative argument results in a negative tick_count.

Header <boost/date_time/time_system_counted.hpp>

namespace boost {
  namespace date_time {
    template<typename config> struct counted_time_rep;

    template<typename time_rep> class counted_time_system;
  }
}

boost::date_time::counted_time_rep
Time representation that uses a single integer count.

template<typename config> 
struct counted_time_rep {
  // types
  typedef config::int_type           int_type;          
  typedef config::date_type          date_type;         
  typedef config::impl_type          impl_type;         
  typedef date_type::duration_type   date_duration_type;
  typedef date_type::calendar_type   calendar_type;     
  typedef date_type::ymd_type        ymd_type;          
  typedef config::time_duration_type time_duration_type;
  typedef config::resolution_traits  resolution_traits; 

  // construct/copy/destruct
  counted_time_rep(const date_type &, const time_duration_type &);
  counted_time_rep(int_type);
  counted_time_rep(impl_type);

  // public member functions
  date_type date() const;
  int_type day_count() const;
  int_type time_count() const;
  int_type tod() const;
  bool is_pos_infinity() const;
  bool is_neg_infinity() const;
  bool is_not_a_date_time() const;
  bool is_special() const;
  impl_type get_rep() const;

  // public static functions
  int_type frac_sec_per_day() ;
};

Description

counted_time_rep construct/copy/destruct

counted_time_rep(const date_type & d, const time_duration_type & tod);

counted_time_rep(int_type count);

counted_time_rep(impl_type count);

counted_time_rep public member functions

date_type date() const;

int_type day_count() const;

int_type time_count() const;

int_type tod() const;

bool is_pos_infinity() const;

bool is_neg_infinity() const;

bool is_not_a_date_time() const;

bool is_special() const;

impl_type get_rep() const;

counted_time_rep public static functions

int_type frac_sec_per_day() ;

boost::date_time::counted_time_system
An unadjusted time system implementation.

template<typename time_rep> 
class counted_time_system {
public:
  // types
  typedef time_rep                                    time_rep_type;          
  typedef time_rep_type::impl_type                    impl_type;              
  typedef time_rep_type::time_duration_type           time_duration_type;     
  typedef time_duration_type::fractional_seconds_type fractional_seconds_type;
  typedef time_rep_type::date_type                    date_type;              
  typedef time_rep_type::date_duration_type           date_duration_type;     

  // public static functions
  template<typename T> void unused_var(const T &) ;
  time_rep_type 
  get_time_rep(const date_type &, const time_duration_type &, 
               date_time::dst_flags = not_dst) ;
  date_type get_date(const time_rep_type &) ;
  time_duration_type get_time_of_day(const time_rep_type &) ;
  std::string zone_name(const time_rep_type &) ;
  bool is_equal(const time_rep_type &, const time_rep_type &) ;
  bool is_less(const time_rep_type &, const time_rep_type &) ;
  time_rep_type add_days(const time_rep_type &, const date_duration_type &) ;
  time_rep_type 
  subtract_days(const time_rep_type &, const date_duration_type &) ;
  time_rep_type 
  subtract_time_duration(const time_rep_type &, const time_duration_type &) ;
  time_rep_type add_time_duration(const time_rep_type &, time_duration_type) ;
  time_duration_type 
  subtract_times(const time_rep_type &, const time_rep_type &) ;
};

Description

counted_time_system public static functions

template<typename T> void unused_var(const T & ) ;

time_rep_type 
get_time_rep(const date_type & day, const time_duration_type & tod, 
             date_time::dst_flags dst = not_dst) ;

date_type get_date(const time_rep_type & val) ;

time_duration_type get_time_of_day(const time_rep_type & val) ;

std::string zone_name(const time_rep_type & ) ;

bool is_equal(const time_rep_type & lhs, const time_rep_type & rhs) ;

bool is_less(const time_rep_type & lhs, const time_rep_type & rhs) ;

time_rep_type 
add_days(const time_rep_type & base, const date_duration_type & dd) ;

time_rep_type 
subtract_days(const time_rep_type & base, const date_duration_type & dd) ;

time_rep_type 
subtract_time_duration(const time_rep_type & base, 
                       const time_duration_type & td) ;

time_rep_type 
add_time_duration(const time_rep_type & base, time_duration_type td) ;

time_duration_type 
subtract_times(const time_rep_type & lhs, const time_rep_type & rhs) ;

Header <boost/date_time/time_system_split.hpp>

namespace boost {
  namespace date_time {
    template<typename config, boost::int32_t ticks_per_second> 
      class split_timedate_system;
  }
}

boost::date_time::split_timedate_system
An unadjusted time system implementation.

template<typename config, boost::int32_t ticks_per_second> 
class split_timedate_system {
public:
  // types
  typedef config::time_rep_type                                              time_rep_type;     
  typedef config::date_type                                                  date_type;         
  typedef config::time_duration_type                                         time_duration_type;
  typedef config::date_duration_type                                         date_duration_type;
  typedef config::int_type                                                   int_type;          
  typedef config::resolution_traits                                          resolution_traits; 
  typedef date_time::wrapping_int< int_type, INT64_C(86400)*ticks_per_second wrap_int_type;     
  typedef date_time::wrapping_int< int_type, ticks_per_day >                 wrap_int_type;     

  // public static functions
  time_rep_type 
  get_time_rep(const date_type &, const time_duration_type &, 
               date_time::dst_flags = not_dst) ;
  date_type get_date(const time_rep_type &) ;
  time_duration_type get_time_of_day(const time_rep_type &) ;
  std::string zone_name(const time_rep_type &) ;
  bool is_equal(const time_rep_type &, const time_rep_type &) ;
  bool is_less(const time_rep_type &, const time_rep_type &) ;
  time_rep_type add_days(const time_rep_type &, const date_duration_type &) ;
  time_rep_type 
  subtract_days(const time_rep_type &, const date_duration_type &) ;
  time_rep_type 
  subtract_time_duration(const time_rep_type &, const time_duration_type &) ;
  time_rep_type add_time_duration(const time_rep_type &, time_duration_type) ;
  time_duration_type 
  subtract_times(const time_rep_type &, const time_rep_type &) ;

  // private member functions
   BOOST_STATIC_CONSTANT(int_type, 
                         ticks_per_day = INT64_C(86400)*config::tick_per_second) ;
};

Description

split_timedate_system public static functions

time_rep_type 
get_time_rep(const date_type & day, const time_duration_type & tod, 
             date_time::dst_flags dst = not_dst) ;

date_type get_date(const time_rep_type & val) ;

time_duration_type get_time_of_day(const time_rep_type & val) ;

std::string zone_name(const time_rep_type & ) ;

bool is_equal(const time_rep_type & lhs, const time_rep_type & rhs) ;

bool is_less(const time_rep_type & lhs, const time_rep_type & rhs) ;

time_rep_type 
add_days(const time_rep_type & base, const date_duration_type & dd) ;

time_rep_type 
subtract_days(const time_rep_type & base, const date_duration_type & dd) ;

time_rep_type 
subtract_time_duration(const time_rep_type & base, 
                       const time_duration_type & td) ;

time_rep_type 
add_time_duration(const time_rep_type & base, time_duration_type td) ;

time_duration_type 
subtract_times(const time_rep_type & lhs, const time_rep_type & rhs) ;

split_timedate_system private member functions

 BOOST_STATIC_CONSTANT(int_type , 
                       ticks_per_day  = INT64_C(86400)*config::tick_per_second) ;

Header <boost/date_time/wrapping_int.hpp>

namespace boost {
  namespace date_time {
    template<typename int_type_, int_type_ wrap_val> class wrapping_int;
    template<typename int_type_, int_type_ wrap_min, int_type_ wrap_max> 
      class wrapping_int2;
  }
}

boost::date_time::wrapping_int
A wrapping integer used to support time durations.

template<typename int_type_, int_type_ wrap_val> 
class wrapping_int {
public:
  // types
  typedef int_type_ int_type;

  // construct/copy/destruct
  wrapping_int(int_type);

  // public member functions
  int_type as_int() const;
  operator int_type() const;
  int_type add(int_type) ;
  int_type subtract(int_type) ;

  // public static functions
  int_type wrap_value() ;
};

Description
In composite date and time types this type is used to wrap at the day boundary.

wrapping_int construct/copy/destruct

wrapping_int(int_type v);

Add, return true if wrapped.

wrapping_int public member functions

int_type as_int() const;

Explicit converion method.

operator int_type() const;

int_type add(int_type v) ;

int_type subtract(int_type v) ;

wrapping_int public static functions

int_type wrap_value() ;

boost::date_time::wrapping_int2
A wrapping integer used to wrap around at the top.

template<typename int_type_, int_type_ wrap_min, int_type_ wrap_max> 
class wrapping_int2 {
public:
  // types
  typedef int_type_ int_type;

  // construct/copy/destruct
  wrapping_int2(int_type);

  // public member functions
  int_type as_int() const;
  operator int_type() const;
  int_type add(int_type) ;
  int_type subtract(int_type) ;

  // public static functions
  unsigned long wrap_value() ;
  unsigned long min_value() ;
};

Description
Bad name, quick impl to fix a bug -- fix later!! This allows the wrap to restart at a value other than 0. Currently this only works if wrap_min == 1

wrapping_int2 construct/copy/destruct

wrapping_int2(int_type v);

If initializing value is out of range of [wrap_min, wrap_max], value will be initialized to closest of min or max

wrapping_int2 public member functions

int_type as_int() const;

Explicit converion method.

operator int_type() const;

int_type add(int_type v) ;

Add, return number of wraps performed.

int_type subtract(int_type v) ;

Subtract will return '-d' if wrapping took place ('d' is the number of wraps).

wrapping_int2 public static functions

unsigned long wrap_value() ;

unsigned long min_value() ;

Header <boost/date_time/year_month_day.hpp>

namespace boost {
  namespace date_time {
    template<typename YearType, typename MonthType, typename DayType> 
      struct year_month_day_base;
  }
}

boost::date_time::year_month_day_base
Allow rapid creation of ymd triples of different types.

template<typename YearType, typename MonthType, typename DayType> 
struct year_month_day_base {
  // types
  typedef YearType  year_type; 
  typedef MonthType month_type;
  typedef DayType   day_type;  

  // construct/copy/destruct
  year_month_day_base(YearType, MonthType, DayType);

  // public member functions

  YearType year;
  MonthType month;
  DayType day;
};

Description

year_month_day_base construct/copy/destruct

year_month_day_base(YearType year, MonthType month, DayType day);

A basic constructor.

year_month_day_base public member functions

Gregorian Reference

Header <boost/date_time/gregorian/formatters.hpp>

namespace boost {
  namespace gregorian {
    template<typename charT> 
      std::basic_string< charT > to_simple_string_type(const date & d);

    // To YYYY-mmm-DD string where mmm 3 char month name. Example: 2002-Jan-01. 
    std::string to_simple_string(const date & d);
    template<typename charT> 
      std::basic_string< charT > to_simple_string_type(const date_period & d);

    // Convert date period to simple string. Example: [2002-Jan-01/2002-Jan-02]. 
    std::string to_simple_string(const date_period & d);
    template<typename charT> 
      std::basic_string< charT > to_iso_string_type(const date_period & d);

    // Date period to iso standard format CCYYMMDD/CCYYMMDD. Example: 20021225/20021231. 
    std::string to_iso_string(const date_period & d);
    template<typename charT> 
      std::basic_string< charT > to_iso_extended_string_type(const date & d);

    // Convert to iso extended format string CCYY-MM-DD. Example 2002-12-31. 
    std::string to_iso_extended_string(const date & d);
    template<typename charT> 
      std::basic_string< charT > to_iso_string_type(const date & d);

    // Convert to iso standard string YYYYMMDD. Example: 20021231. 
    std::string to_iso_string(const date & d);
    template<typename charT> 
      std::basic_string< charT > to_sql_string_type(const date & d);
    std::string to_sql_string(const date & d);

    // Convert date period to simple string. Example: [2002-Jan-01/2002-Jan-02]. 
    std::wstring to_simple_wstring(const date_period & d);

    // To YYYY-mmm-DD string where mmm 3 char month name. Example: 2002-Jan-01. 
    std::wstring to_simple_wstring(const date & d);

    // Date period to iso standard format CCYYMMDD/CCYYMMDD. Example: 20021225/20021231. 
    std::wstring to_iso_wstring(const date_period & d);

    // Convert to iso extended format string CCYY-MM-DD. Example 2002-12-31. 
    std::wstring to_iso_extended_wstring(const date & d);

    // Convert to iso standard string YYYYMMDD. Example: 20021231. 
    std::wstring to_iso_wstring(const date & d);
    std::wstring to_sql_wstring(const date & d);
  }
}

Header <boost/date_time/gregorian/formatters_limited.hpp>

namespace boost {
  namespace gregorian {
  }
}

Header <boost/date_time/gregorian/greg_calendar.hpp>

namespace boost {
  namespace gregorian {
    class gregorian_calendar;

    typedef date_time::int_adapter< unsigned long > fancy_date_rep;  // An internal date representation that includes infinities, not a date. 
  }
}

boost::gregorian::gregorian_calendar
Gregorian calendar for this implementation, hard work in the base.

class gregorian_calendar {
public:
  // types
  typedef greg_weekday         day_of_week_type;  // Type to hold a weekday (eg: Sunday, Monday,...). 
  typedef greg_day_of_year_rep day_of_year_type;  // Counter type from 1 to 366 for gregorian dates. 
  typedef fancy_date_rep       date_rep_type;     // Internal date representation that handles infinity, not a date. 
  typedef fancy_date_rep       date_traits_type;  // Date rep implements the traits stuff as well. 
};

Header <boost/date_time/gregorian/greg_date.hpp>

namespace boost {
  namespace gregorian {
    class date;
  }
}

boost::gregorian::date
A date type based on gregorian_calendar.

class date {
public:
  // types
  typedef gregorian_calendar::year_type        year_type;       
  typedef gregorian_calendar::month_type       month_type;      
  typedef gregorian_calendar::day_type         day_type;        
  typedef gregorian_calendar::day_of_year_type day_of_year_type;
  typedef gregorian_calendar::ymd_type         ymd_type;        
  typedef gregorian_calendar::date_rep_type    date_rep_type;   
  typedef gregorian_calendar::date_int_type    date_int_type;   
  typedef date_duration                        duration_type;   

  // construct/copy/destruct
  date();
  date(year_type, month_type, day_type);
  date(const ymd_type &);
  date(const date_int_type &);
  date(date_rep_type);
  date(special_values);

  // public member functions
  date_int_type julian_day() const;
  day_of_year_type day_of_year() const;
  long modjulian_day() const;
  int week_number() const;
  date_int_type day_number() const;
};

Description
This class is the primary interface for programming with greogorian dates. The is a lightweight type that can be freely passed by value. All comparison operators are supported.

date construct/copy/destruct

date();

Default constructor constructs with not_a_date_time.

date(year_type y, month_type m, day_type d);

Main constructor with year, month, day.

date(const ymd_type & ymd);

Constructor from a ymd_type structure.

date(const date_int_type & rhs);

Needed copy constructor.

date(date_rep_type rhs);

Needed copy constructor.

date(special_values sv);

Constructor for infinities, not a date, max and min date.

date public member functions

date_int_type julian_day() const;

Return the Julian Day number for the date.

day_of_year_type day_of_year() const;

Return the day of year 1..365 or 1..366 (for leap year).

long modjulian_day() const;

Return the Modified Julian Day number for the date.

int week_number() const;

Return the iso 8601 week number 1..53.

date_int_type day_number() const;

Return the day number from the calendar.

Header <boost/date_time/gregorian/greg_day.hpp>

namespace boost {
  namespace gregorian {
    struct bad_day_of_month;

    class greg_day;

    typedef CV::simple_exception_policy< unsigned short, 1, 31, bad_day_of_month > greg_day_policies;  // Policy class that declares error handling and day of month ranges. 
    typedef CV::constrained_value< greg_day_policies > greg_day_rep;  // Generated represetation for gregorian day of month. 
  }
}

boost::gregorian::bad_day_of_month
Exception type for gregorian day of month (1..31).

struct bad_day_of_month {
  // construct/copy/destruct
  bad_day_of_month();
  bad_day_of_month(const std::string &);

  // public member functions
};

Description

bad_day_of_month construct/copy/destruct

bad_day_of_month();

bad_day_of_month(const std::string & s);

Allow other classes to throw with unique string for bad day like Feb 29.

bad_day_of_month public member functions
boost::gregorian::greg_day
Represent a day of the month (range 1 - 31).

class greg_day {
public:
  // construct/copy/destruct
  greg_day(unsigned short);

  // public member functions
  unsigned short as_number() const;
  operator unsigned short() const;
};

Description
This small class allows for simple conversion an integer value into a day of the month for a standard gregorian calendar. The type is automatically range checked so values outside of the range 1-31 will cause a bad_day_of_month exception

greg_day construct/copy/destruct

greg_day(unsigned short day_of_month);

greg_day public member functions

unsigned short as_number() const;

operator unsigned short() const;

Header <boost/date_time/gregorian/greg_day_of_year.hpp>

namespace boost {
  namespace gregorian {
    struct bad_day_of_year;

    typedef CV::simple_exception_policy< unsigned short, 1, 366, bad_day_of_year > greg_day_of_year_policies;  // A day of the year range (1..366). 
    typedef CV::constrained_value< greg_day_of_year_policies > greg_day_of_year_rep;  // Define a range representation type for the day of the year 1..366. 
  }
}

boost::gregorian::bad_day_of_year
Exception type for day of year (1..366).

struct bad_day_of_year {
  // construct/copy/destruct
  bad_day_of_year();

  // public member functions
};

Description

bad_day_of_year construct/copy/destruct

bad_day_of_year();

bad_day_of_year public member functions

Header <boost/date_time/gregorian/greg_duration.hpp>

namespace boost {
  namespace gregorian {
    typedef boost::date_time::duration_traits_adapted date_duration_rep;  // An internal date representation that includes infinities, not a date. 
    typedef date_time::date_duration< date_duration_rep > date_duration;  // Durations in days for gregorian system. 
    typedef date_duration days;  // Shorthand for date_duration. 
  }
}

Header <boost/date_time/gregorian/greg_duration_types.hpp>

namespace boost {
  namespace gregorian {
    struct greg_durations_config;

    typedef date_time::months_duration< greg_durations_config > months;
    typedef date_time::years_duration< greg_durations_config > years;
    typedef date_time::weeks_duration< date_time::duration_traits_adapted > weeks;
  }
}

boost::gregorian::greg_durations_config
config struct for additional duration types (ie months_duration<> & years_duration<>)

struct greg_durations_config {
  // types
  typedef date                                  date_type;          
  typedef date_time::int_adapter< int >         int_rep;            
  typedef date_time::month_functor< date_type > month_adjustor_type;
};

Header <boost/date_time/gregorian/greg_facet.hpp>

namespace boost {
  namespace gregorian {
    struct greg_facet_config;

    typedef boost::date_time::date_names_put< greg_facet_config > greg_base_facet;  // Create the base facet type for gregorian::date. 
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > &, const date &);
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > &, const greg_month &);
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > &, const greg_weekday &);
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > &, const date_period &);
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > & os, 
                 const date_duration & dd);

    // operator<< for gregorian::partial_date. Output: "Jan 1" 
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > & os, 
                 const partial_date & pd);

    // operator<< for gregorian::nth_kday_of_month. Output: "first Mon of Jun" 
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > & os, 
                 const nth_kday_of_month & nkd);

    // operator<< for gregorian::first_kday_of_month. Output: "first Mon of Jun" 
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > & os, 
                 const first_kday_of_month & fkd);

    // operator<< for gregorian::last_kday_of_month. Output: "last Mon of Jun" 
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > & os, 
                 const last_kday_of_month & lkd);

    // operator<< for gregorian::first_kday_after. Output: "first Mon after" 
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > & os, 
                 const first_kday_after & fka);

    // operator<< for gregorian::first_kday_before. Output: "first Mon before" 
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > & os, 
                 const first_kday_before & fkb);

    // operator>> for gregorian::date 
    template<typename charT> 
      std::basic_istream< charT > & 
      operator>>(std::basic_istream< charT > & is, date & d);

    // operator>> for gregorian::date_duration 
    template<typename charT> 
      std::basic_istream< charT > & 
      operator>>(std::basic_istream< charT > & is, date_duration & dd);

    // operator>> for gregorian::date_period 
    template<typename charT> 
      std::basic_istream< charT > & 
      operator>>(std::basic_istream< charT > & is, date_period & dp);

    // generates a locale with the set of gregorian name-strings of type char* 
    BOOST_DATE_TIME_DECL std::locale 
    generate_locale(std::locale & loc, char type);

    // Returns a pointer to a facet with a default set of names (English). 
    BOOST_DATE_TIME_DECL boost::date_time::all_date_names_put< greg_facet_config, char > * 
    create_facet_def(char type);

    // generates a locale with the set of gregorian name-strings of type wchar_t* 
    BOOST_DATE_TIME_DECL std::locale 
    generate_locale(std::locale & loc, wchar_t type);

    // Returns a pointer to a facet with a default set of names (English). 
    BOOST_DATE_TIME_DECL boost::date_time::all_date_names_put< greg_facet_config, wchar_t > * 
    create_facet_def(wchar_t type);

    // operator>> for gregorian::greg_month - throws exception if invalid month given 
    template<typename charT> 
      std::basic_istream< charT > & 
      operator>>(std::basic_istream< charT > & is, greg_month & m);

    // operator>> for gregorian::greg_weekday - throws exception if invalid weekday given 
    template<typename charT> 
      std::basic_istream< charT > & 
      operator>>(std::basic_istream< charT > & is, greg_weekday & wd);
  }
}

boost::gregorian::greg_facet_config
Configuration of the output facet template.

struct greg_facet_config {
  // types
  typedef boost::gregorian::greg_month     month_type;        
  typedef boost::date_time::special_values special_value_enum;
  typedef boost::gregorian::months_of_year month_enum;        
  typedef boost::date_time::weekdays       weekday_enum;      
};

boost::gregorian::operator<<
ostream operator for gregorian::date

template<typename charT, typename traits> 
  std::basic_ostream< charT, traits > & 
  operator<<(std::basic_ostream< charT, traits > & os, const date & d);

Description
Uses the date facet to determine various output parameters including:
string values for the month (eg: Jan, Feb, Mar) (default: English)
string values for special values (eg: not-a-date-time) (default: English)
selection of long, short strings, or numerical month representation (default: short string)
month day year order (default yyyy-mmm-dd)
boost::gregorian::operator<<
operator<< for gregorian::greg_month typically streaming: Jan, Feb, Mar...

template<typename charT, typename traits> 
  std::basic_ostream< charT, traits > & 
  operator<<(std::basic_ostream< charT, traits > & os, const greg_month & m);

Description
Uses the date facet to determine output string as well as selection of long or short strings. Default if no facet is installed is to output a 2 wide numeric value for the month eg: 01 == Jan, 02 == Feb, ... 12 == Dec.
boost::gregorian::operator<<
operator<< for gregorian::greg_weekday typically streaming: Sun, Mon, Tue, ...

template<typename charT, typename traits> 
  std::basic_ostream< charT, traits > & 
  operator<<(std::basic_ostream< charT, traits > & os, 
             const greg_weekday & wd);

Description
Uses the date facet to determine output string as well as selection of long or short string. Default if no facet is installed is to output a 3 char english string for the day of the week.
boost::gregorian::operator<<
operator<< for gregorian::date_period typical output: [2002-Jan-01/2002-Jan-31]

template<typename charT, typename traits> 
  std::basic_ostream< charT, traits > & 
  operator<<(std::basic_ostream< charT, traits > & os, const date_period & dp);

Description
Uses the date facet to determine output string as well as selection of long or short string fr dates. Default if no facet is installed is to output a 3 char english string for the day of the week.

Header <boost/date_time/gregorian/greg_month.hpp>

namespace boost {
  namespace gregorian {
    struct bad_month;

    class greg_month;

    typedef date_time::months_of_year months_of_year;
    typedef CV::simple_exception_policy< unsigned short, 1, 12, bad_month > greg_month_policies;  // Build a policy class for the greg_month_rep. 
    typedef CV::constrained_value< greg_month_policies > greg_month_rep;  // A constrained range that implements the gregorian_month rules. 
  }
}

boost::gregorian::bad_month
Exception thrown if a greg_month is constructed with a value out of range.

struct bad_month {
  // construct/copy/destruct
  bad_month();

  // public member functions
};

Description

bad_month construct/copy/destruct

bad_month();

bad_month public member functions
boost::gregorian::greg_month
Wrapper class to represent months in gregorian based calendar.

class greg_month {
public:
  // types
  typedef date_time::months_of_year               month_enum;        
  typedef std::map< std::string, unsigned short > month_map_type;    
  typedef boost::shared_ptr< month_map_type >     month_map_ptr_type;

  // construct/copy/destruct
  greg_month(month_enum);
  greg_month(unsigned short);

  // public member functions
  operator unsigned short() const;
  unsigned short as_number() const;
  month_enum as_enum() const;
  const char * as_short_string() const;
  const char * as_long_string() const;
  const wchar_t * as_short_wstring() const;
  const wchar_t * as_long_wstring() const;
  const char * as_short_string(char) const;
  const char * as_long_string(char) const;
  const wchar_t * as_short_string(wchar_t) const;
  const wchar_t * as_long_string(wchar_t) const;

  // public static functions
  month_map_ptr_type get_month_map_ptr() ;
};

Description

greg_month construct/copy/destruct

greg_month(month_enum theMonth);

Construct a month from the months_of_year enumeration.

greg_month(unsigned short theMonth);

Construct from a short value.

greg_month public member functions

operator unsigned short() const;

Convert the value back to a short.

unsigned short as_number() const;

Returns month as number from 1 to 12.

month_enum as_enum() const;

const char * as_short_string() const;

const char * as_long_string() const;

const wchar_t * as_short_wstring() const;

const wchar_t * as_long_wstring() const;

const char * as_short_string(char ) const;

const char * as_long_string(char ) const;

const wchar_t * as_short_string(wchar_t ) const;

const wchar_t * as_long_string(wchar_t ) const;

greg_month public static functions

month_map_ptr_type get_month_map_ptr() ;

Shared pointer to a map of Month strings (Names & Abbrev) & numbers.

Header <boost/date_time/gregorian/greg_weekday.hpp>

namespace boost {
  namespace gregorian {
    struct bad_weekday;

    class greg_weekday;

    typedef CV::simple_exception_policy< unsigned short, 0, 6, bad_weekday > greg_weekday_policies;
    typedef CV::constrained_value< greg_weekday_policies > greg_weekday_rep;
  }
}

boost::gregorian::bad_weekday
Exception that flags that a weekday number is incorrect.

struct bad_weekday {
  // construct/copy/destruct
  bad_weekday();

  // public member functions
};

Description

bad_weekday construct/copy/destruct

bad_weekday();

bad_weekday public member functions
boost::gregorian::greg_weekday
Represent a day within a week (range 0==Sun to 6==Sat).

class greg_weekday {
public:
  // types
  typedef boost::date_time::weekdays weekday_enum;

  // construct/copy/destruct
  greg_weekday(unsigned short);

  // public member functions
  unsigned short as_number() const;
  const char * as_short_string() const;
  const char * as_long_string() const;
  const wchar_t * as_short_wstring() const;
  const wchar_t * as_long_wstring() const;
  weekday_enum as_enum() const;
};

Description

greg_weekday construct/copy/destruct

greg_weekday(unsigned short day_of_week_num);

greg_weekday public member functions

unsigned short as_number() const;

const char * as_short_string() const;

const char * as_long_string() const;

const wchar_t * as_short_wstring() const;

const wchar_t * as_long_wstring() const;

weekday_enum as_enum() const;

Header <boost/date_time/gregorian/greg_year.hpp>

namespace boost {
  namespace gregorian {
    struct bad_year;

    class greg_year;

    typedef CV::simple_exception_policy< unsigned short, 1400, 10000, bad_year > greg_year_policies;  // Policy class that declares error handling gregorian year type. 
    typedef CV::constrained_value< greg_year_policies > greg_year_rep;  // Generated representation for gregorian year. 
  }
}

boost::gregorian::bad_year
Exception type for gregorian year.

struct bad_year {
  // construct/copy/destruct
  bad_year();

  // public member functions
};

Description

bad_year construct/copy/destruct

bad_year();

bad_year public member functions
boost::gregorian::greg_year
Represent a day of the month (range 1900 - 10000).

class greg_year {
public:
  // construct/copy/destruct
  greg_year(unsigned short);

  // public member functions
  operator unsigned short() const;
};

Description
This small class allows for simple conversion an integer value into a year for the gregorian calendar. This currently only allows a range of 1900 to 10000. Both ends of the range are a bit arbitrary at the moment, but they are the limits of current testing of the library. As such they may be increased in the future.

greg_year construct/copy/destruct

greg_year(unsigned short year);

greg_year public member functions

operator unsigned short() const;

Header <boost/date_time/gregorian/greg_ymd.hpp>

namespace boost {
  namespace gregorian {
    typedef date_time::year_month_day_base< greg_year, greg_month, greg_day > greg_year_month_day;
  }
}

Header <boost/date_time/gregorian/gregorian.hpp>
Single file header that provides overall include for all elements of the gregorian date-time system. This includes the various types defined, but also other functions for formatting and parsing.

Header <boost/date_time/gregorian/gregorian_types.hpp>
Single file header that defines most of the types for the gregorian date-time system.

namespace boost {
  namespace gregorian {
    typedef date_time::period< date, date_duration > date_period;  // Date periods for the gregorian system. 
    typedef date_time::year_based_generator< date > year_based_generator;  // A unifying date_generator base type. 
    typedef date_time::partial_date< date > partial_date;  // A date generation object type. 
    typedef date_time::nth_kday_of_month< date > nth_kday_of_month;
    typedef nth_kday_of_month nth_day_of_the_week_in_month;
    typedef date_time::first_kday_of_month< date > first_kday_of_month;
    typedef first_kday_of_month first_day_of_the_week_in_month;
    typedef date_time::last_kday_of_month< date > last_kday_of_month;
    typedef last_kday_of_month last_day_of_the_week_in_month;
    typedef date_time::first_kday_after< date > first_kday_after;
    typedef first_kday_after first_day_of_the_week_after;
    typedef date_time::first_kday_before< date > first_kday_before;
    typedef first_kday_before first_day_of_the_week_before;
    typedef date_time::day_clock< date > day_clock;  // A clock to get the current day from the local computer. 
    typedef date_time::date_itr_base< date > date_iterator;  // Base date_iterator type for gregorian types. 
    typedef date_time::date_itr< date_time::day_functor< date >, date > day_iterator;  // A day level iterator. 
    typedef date_time::date_itr< date_time::week_functor< date >, date > week_iterator;  // A week level iterator. 
    typedef date_time::date_itr< date_time::month_functor< date >, date > month_iterator;  // A month level iterator. 
    typedef date_time::date_itr< date_time::year_functor< date >, date > year_iterator;  // A year level iterator. 
  }
}

Header <boost/date_time/gregorian/parsers.hpp>

namespace boost {
  namespace gregorian {

    // Deprecated: Use from_simple_string. 
    date from_string(std::string s);

    // From delimited date string where with order year-month-day eg: 2002-1-25 or 2003-Jan-25 (full month name is also accepted). 
    date from_simple_string(std::string s);

    // From delimited date string where with order year-month-day eg: 1-25-2003 or Jan-25-2003 (full month name is also accepted). 
    date from_us_string(std::string s);

    // From delimited date string where with order day-month-year eg: 25-1-2002 or 25-Jan-2003 (full month name is also accepted). 
    date from_uk_string(std::string s);

    // From iso type date string where with order year-month-day eg: 20020125. 
    date from_undelimited_string(std::string s);

    // From iso type date string where with order year-month-day eg: 20020125. 
    date date_from_iso_string(const std::string & s);

    // Stream should hold a date in the form of: 2002-1-25. Month number, abbrev, or name are accepted. 
    template<typename iterator_type> 
      date from_stream(iterator_type beg, iterator_type end);

    // Function to parse a date_period from a string (eg: [2003-Oct-31/2003-Dec-25]). 
    date_period date_period_from_string(const std::string & s);

    // Function to parse a date_period from a wstring (eg: [2003-Oct-31/2003-Dec-25]). 
    date_period date_period_from_wstring(const std::wstring & s);
  }
}

Posix Time Reference

Header <boost/date_time/posix_time/conversion.hpp>

namespace boost {
  namespace posix_time {

    // Function that converts a time_t into a ptime. 
    ptime from_time_t(std::time_t t);
    template<typename time_type> time_type from_ftime(const FILETIME &);
  }
}

boost::posix_time::from_ftime
Function to create a time object from an initialized FILETIME struct.

template<typename time_type> time_type from_ftime(const FILETIME & ft);

Description
Function to create a time object from an initialized FILETIME struct. A FILETIME struct holds 100-nanosecond units (0.0000001). When built with microsecond resolution the FILETIME's sub second value will be truncated. Nanosecond resolution has no truncation.
Note ftime is part of the Win32 API, so it is not portable to non-windows platforms.

Header <boost/date_time/posix_time/date_duration_operators.hpp>
Operators for ptime and optional gregorian types. Operators use snap-to-end-of-month behavior. Further details on this behavior can be found in reference for date_time/date_duration_types.hpp and documentation for month and year iterators.

namespace boost {
  namespace posix_time {
    ptime operator+(const ptime &, const boost::gregorian::months &);
    ptime operator+=(ptime &, const boost::gregorian::months &);
    ptime operator-(const ptime &, const boost::gregorian::months &);
    ptime operator-=(ptime &, const boost::gregorian::months &);
    ptime operator+(const ptime &, const boost::gregorian::years &);
    ptime operator+=(ptime &, const boost::gregorian::years &);
    ptime operator-(const ptime &, const boost::gregorian::years &);
    ptime operator-=(ptime &, const boost::gregorian::years &);
  }
}

boost::posix_time::operator+

ptime operator+(const ptime & t, const boost::gregorian::months & m);

Description
Adds a months object and a ptime. Result will be same day-of-month as ptime unless original day was the last day of month. see date_time::months_duration for more details
boost::posix_time::operator+=

ptime operator+=(ptime & t, const boost::gregorian::months & m);

Description
Adds a months object to a ptime. Result will be same day-of-month as ptime unless original day was the last day of month. see date_time::months_duration for more details
boost::posix_time::operator-

ptime operator-(const ptime & t, const boost::gregorian::months & m);

Description
Subtracts a months object and a ptime. Result will be same day-of-month as ptime unless original day was the last day of month. see date_time::months_duration for more details
boost::posix_time::operator-=

ptime operator-=(ptime & t, const boost::gregorian::months & m);

Description
Subtracts a months object from a ptime. Result will be same day-of-month as ptime unless original day was the last day of month. see date_time::months_duration for more details
boost::posix_time::operator+

ptime operator+(const ptime & t, const boost::gregorian::years & y);

Description
Adds a years object and a ptime. Result will be same month and day-of-month as ptime unless original day was the last day of month. see date_time::years_duration for more details
boost::posix_time::operator+=

ptime operator+=(ptime & t, const boost::gregorian::years & y);

Description
Adds a years object to a ptime. Result will be same month and day-of-month as ptime unless original day was the last day of month. see date_time::years_duration for more details
boost::posix_time::operator-

ptime operator-(const ptime & t, const boost::gregorian::years & y);

Description
Subtracts a years object and a ptime. Result will be same month and day-of-month as ptime unless original day was the last day of month. see date_time::years_duration for more details
boost::posix_time::operator-=

ptime operator-=(ptime & t, const boost::gregorian::years & y);

Description
Subtracts a years object from a ptime. Result will be same month and day-of-month as ptime unless original day was the last day of month. see date_time::years_duration for more details

Header <boost/date_time/posix_time/posix_time.hpp>
Global header file to get all of posix time types

Header <boost/date_time/posix_time/posix_time_config.hpp>

namespace boost {
  namespace posix_time {
    class time_duration;

    struct simple_time_rep;

    class posix_time_system_config;
    class millisec_posix_time_system_config;

    typedef date_time::time_resolution_traits< boost::date_time::time_resolution_traits_adapted64_impl, boost::date_time::nano, 1000000000, 9 > time_res_traits;
  }
}

boost::posix_time::time_duration
Base time duration type.

class time_duration {
public:
  // types
  typedef time_res_traits                          rep_type;               
  typedef time_res_traits::day_type                day_type;               
  typedef time_res_traits::hour_type               hour_type;              
  typedef time_res_traits::min_type                min_type;               
  typedef time_res_traits::sec_type                sec_type;               
  typedef time_res_traits::fractional_seconds_type fractional_seconds_type;
  typedef time_res_traits::tick_type               tick_type;              
  typedef time_res_traits::impl_type               impl_type;              

  // construct/copy/destruct
  time_duration(hour_type, min_type, sec_type, fractional_seconds_type = 0);
  time_duration();
  time_duration(boost::date_time::special_values);
  time_duration(impl_type);

  // public member functions

  // private member functions
};

Description

time_duration construct/copy/destruct

time_duration(hour_type hour, min_type min, sec_type sec, 
              fractional_seconds_type fs = 0);

time_duration();

time_duration(boost::date_time::special_values sv);

Construct from special_values.

time_duration(impl_type ticks);

time_duration public member functions

time_duration private member functions
boost::posix_time::simple_time_rep
Simple implementation for the time rep.

struct simple_time_rep {
  // types
  typedef gregorian::date date_type;         
  typedef time_duration   time_duration_type;

  // construct/copy/destruct
  simple_time_rep(date_type, time_duration_type);

  // public member functions
  bool is_special() const;
  bool is_pos_infinity() const;
  bool is_neg_infinity() const;
  bool is_not_a_date_time() const;

  date_type day;
  time_duration_type time_of_day;
};

Description

simple_time_rep construct/copy/destruct

simple_time_rep(date_type d, time_duration_type tod);

simple_time_rep public member functions

bool is_special() const;

bool is_pos_infinity() const;

bool is_neg_infinity() const;

bool is_not_a_date_time() const;

boost::posix_time::posix_time_system_config

class posix_time_system_config {
public:
  // types
  typedef simple_time_rep            time_rep_type;     
  typedef gregorian::date            date_type;         
  typedef gregorian::date_duration   date_duration_type;
  typedef time_duration              time_duration_type;
  typedef time_res_traits::tick_type int_type;          
  typedef time_res_traits            resolution_traits; 

  // public member functions
   BOOST_STATIC_CONSTANT(boost::int64_t, tick_per_second = 1000000000) ;
};

Description

posix_time_system_config public member functions

 BOOST_STATIC_CONSTANT(boost::int64_t , tick_per_second  = 1000000000) ;

boost::posix_time::millisec_posix_time_system_config

class millisec_posix_time_system_config {
public:
  // types
  typedef boost::int64_t             time_rep_type;     
  typedef gregorian::date            date_type;         
  typedef gregorian::date_duration   date_duration_type;
  typedef time_duration              time_duration_type;
  typedef time_res_traits::tick_type int_type;          
  typedef time_res_traits::impl_type impl_type;         
  typedef time_res_traits            resolution_traits; 

  // public member functions
   BOOST_STATIC_CONSTANT(boost::int64_t, tick_per_second = 1000000) ;
};

Description

millisec_posix_time_system_config public member functions

 BOOST_STATIC_CONSTANT(boost::int64_t , tick_per_second  = 1000000) ;

Header <boost/date_time/posix_time/posix_time_duration.hpp>

namespace boost {
  namespace posix_time {
    class hours;
    class minutes;
    class seconds;

    typedef date_time::subsecond_duration< time_duration, 1000 > millisec;  // Allows expression of durations as milli seconds. 
    typedef date_time::subsecond_duration< time_duration, 1000 > milliseconds;
    typedef date_time::subsecond_duration< time_duration, 1000000 > microsec;  // Allows expression of durations as micro seconds. 
    typedef date_time::subsecond_duration< time_duration, 1000000 > microseconds;
    typedef date_time::subsecond_duration< time_duration, 1000000000 > nanosec;  // Allows expression of durations as nano seconds. 
    typedef date_time::subsecond_duration< time_duration, 1000000000 > nanoseconds;
  }
}

boost::posix_time::hours
Allows expression of durations as an hour count.

class hours : public boost::posix_time::time_duration {
public:
  // construct/copy/destruct
  hours(long);

  // public member functions
};

Description

hours construct/copy/destruct

hours(long h);

hours public member functions
boost::posix_time::minutes
Allows expression of durations as a minute count.

class minutes : public boost::posix_time::time_duration {
public:
  // construct/copy/destruct
  minutes(long);

  // public member functions
};

Description

minutes construct/copy/destruct

minutes(long m);

minutes public member functions
boost::posix_time::seconds
Allows expression of durations as a seconds count.

class seconds : public boost::posix_time::time_duration {
public:
  // construct/copy/destruct
  seconds(long);

  // public member functions
};

Description

seconds construct/copy/destruct

seconds(long s);

seconds public member functions

Header <boost/date_time/posix_time/posix_time_system.hpp>

namespace boost {
  namespace posix_time {
    typedef date_time::split_timedate_system< posix_time_system_config, 1000000000 > posix_time_system;
    typedef date_time::counted_time_rep< millisec_posix_time_system_config > int64_time_rep;
  }
}

Header <boost/date_time/posix_time/posix_time_types.hpp>

namespace boost {
  namespace posix_time {
    typedef date_time::time_itr< ptime > time_iterator;  // Iterator over a defined time duration. 
    typedef date_time::second_clock< ptime::date_type, ptime > second_clock;  // A time clock that has a resolution of one second. 
    typedef date_time::microsec_clock< ptime > microsec_clock;  // A time clock that has a resolution of one microsecond. 
    typedef date_time::null_dst_rules< ptime::date_type, time_duration > no_dst;  // Define a dst null dst rule for the posix_time system. 
    typedef date_time::us_dst_rules< ptime::date_type, time_duration > us_dst;  // Define US dst rule calculator for the posix_time system. 
  }
}

Header <boost/date_time/posix_time/ptime.hpp>

namespace boost {
  namespace posix_time {
    class ptime;
  }
}

boost::posix_time::ptime
Time type with no timezone or other adjustments.

class ptime {
public:
  // types
  typedef posix_time_system                    time_system_type;  
  typedef time_system_type::time_rep_type      time_rep_type;     
  typedef time_system_type::time_duration_type time_duration_type;
  typedef ptime                                time_type;         

  // construct/copy/destruct
  ptime(gregorian::date, time_duration_type);
  ptime(gregorian::date);
  ptime(const time_rep_type &);
  ptime(const special_values);
  ptime();

  // public member functions
};

Description

ptime construct/copy/destruct

ptime(gregorian::date d, time_duration_type td);

Construct with date and offset in day.

ptime(gregorian::date d);

Construct a time at start of the given day (midnight).

ptime(const time_rep_type & rhs);

Copy from time_rep.

ptime(const special_values sv);

Construct from special value.

ptime();

ptime public member functions

Header <boost/date_time/posix_time/time_formatters.hpp>

namespace boost {
  namespace posix_time {
    template<typename charT> 
      std::basic_string< charT > to_simple_string_type(time_duration td);
    template<typename charT> 
      std::basic_string< charT > to_iso_string_type(time_duration td);

    // Time to simple format CCYY-mmm-dd hh:mm:ss.fffffff. 
    template<typename charT> 
      std::basic_string< charT > to_simple_string_type(ptime t);
    template<typename charT> 
      std::basic_string< charT > to_simple_string_type(time_period tp);
    template<typename charT> 
      std::basic_string< charT > to_iso_string_type(ptime t);
    template<typename charT> 
      std::basic_string< charT > to_iso_extended_string_type(ptime t);

    // Time duration to wstring -hh::mm::ss.fffffff. Example: 10:09:03.0123456. 
    std::wstring to_simple_wstring(time_duration td);

    // Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456. 
    std::wstring to_iso_wstring(time_duration td);
    std::wstring to_simple_wstring(ptime t);

    // Convert to wstring of form [YYYY-mmm-DD HH:MM::SS.ffffff/YYYY-mmm-DD HH:MM::SS.fffffff]. 
    std::wstring to_simple_wstring(time_period tp);

    // Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator. 
    std::wstring to_iso_wstring(ptime t);

    // Convert to form YYYY-MM-DDTHH:MM:SS where T is the date-time separator. 
    std::wstring to_iso_extended_wstring(ptime t);
    template<typename charT> 
      std::basic_istream< charT > & 
      operator>>(std::basic_istream< charT > & is, time_duration & td);
    template<typename charT> 
      std::basic_istream< charT > & 
      operator>>(std::basic_istream< charT > & is, ptime & pt);
    template<typename charT> 
      std::basic_istream< charT > & 
      operator>>(std::basic_istream< charT > &, time_period &);
  }
}

boost::posix_time::operator>>

template<typename charT> 
  std::basic_istream< charT > & 
  operator>>(std::basic_istream< charT > & is, time_period & tp);

Description
operator>> for time_period. time_period must be in "[date time_duration/date time_duration]" format.

Header <boost/date_time/posix_time/time_formatters_limited.hpp>

namespace boost {
  namespace posix_time {

    // Time duration to string -hh::mm::ss.fffffff. Example: 10:09:03.0123456. 
    std::string to_simple_string(time_duration td);

    // Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456. 
    std::string to_iso_string(time_duration td);

    // Time to simple format CCYY-mmm-dd hh:mm:ss.fffffff. 
    std::string to_simple_string(ptime t);

    // Convert to string of form [YYYY-mmm-DD HH:MM::SS.ffffff/YYYY-mmm-DD HH:MM::SS.fffffff]. 
    std::string to_simple_string(time_period tp);

    // Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator. 
    std::string to_iso_string(ptime t);

    // Convert to form YYYY-MM-DDTHH:MM:SS where T is the date-time separator. 
    std::string to_iso_extended_string(ptime t);

    // ostream operator for posix_time::time_duration 
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > & os, 
                 const time_duration & td);

    // ostream operator for posix_time::ptime 
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > & os, const ptime & t);

    // ostream operator for posix_time::time_period 
    template<typename charT, typename traits> 
      std::basic_ostream< charT, traits > & 
      operator<<(std::basic_ostream< charT, traits > & os, 
                 const time_period & tp);
  }
}

Header <boost/date_time/posix_time/time_parsers.hpp>

namespace boost {
  namespace posix_time {
    time_duration duration_from_string(const std::string &);
    ptime time_from_string(const std::string & s);
    ptime from_iso_string(const std::string & s);
  }
}

boost::posix_time::duration_from_string
Creates a time_duration object from a delimited string.

time_duration duration_from_string(const std::string & s);

Description
Expected format for string is "[-]h[h][:mm][:ss][.fff]". A negative duration will be created if the first character in string is a '-', all other '-' will be treated as delimiters. Accepted delimiters are "-:,.".

Header <boost/date_time/posix_time/time_period.hpp>

namespace boost {
  namespace posix_time {
    typedef date_time::period< ptime, time_duration > time_period;  // Time period type. 
  }
}