Boost C++ Libraries

“...one of the most highly regarded and expertly designed C++ library projects in the world.” Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

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>
Header <boost/date_time/c_local_time_adjustor.hpp>
Header <boost/date_time/c_time.hpp>
Header <boost/date_time/compiler_config.hpp>
Header <boost/date_time/constrained_value.hpp>
Header <boost/date_time/date.hpp>
Header <boost/date_time/date_clock_device.hpp>
Header <boost/date_time/date_defs.hpp>
Header <boost/date_time/date_duration.hpp>
Header <boost/date_time/date_duration_types.hpp>
Header <boost/date_time/date_facet.hpp>
Header <boost/date_time/date_format_simple.hpp>
Header <boost/date_time/date_formatting.hpp>
Header <boost/date_time/date_formatting_limited.hpp>
Header <boost/date_time/date_formatting_locales.hpp>
Header <boost/date_time/date_generator_formatter.hpp>
Header <boost/date_time/date_generator_parser.hpp>
Header <boost/date_time/date_generators.hpp>
Header <boost/date_time/date_iterator.hpp>
Header <boost/date_time/date_names_put.hpp>
Header <boost/date_time/dst_rules.hpp>
Header <boost/date_time/dst_transition_generators.hpp>
Header <boost/date_time/filetime_functions.hpp>
Header <boost/date_time/format_date_parser.hpp>
Header <boost/date_time/gregorian_calendar.hpp>
Header <boost/date_time/int_adapter.hpp>
Header <boost/date_time/iso_format.hpp>
Header <boost/date_time/local_time_adjustor.hpp>
Header <boost/date_time/local_timezone_defs.hpp>
Header <boost/date_time/microsec_time_clock.hpp>
Header <boost/date_time/parse_format_base.hpp>
Header <boost/date_time/period.hpp>
Header <boost/date_time/period_formatter.hpp>
Header <boost/date_time/period_parser.hpp>
Header <boost/date_time/special_defs.hpp>
Header <boost/date_time/special_values_formatter.hpp>
Header <boost/date_time/special_values_parser.hpp>
Header <boost/date_time/string_convert.hpp>
Header <boost/date_time/string_parse_tree.hpp>
Header <boost/date_time/strings_from_facet.hpp>
Header <boost/date_time/time.hpp>
Header <boost/date_time/time_clock.hpp>
Header <boost/date_time/time_defs.hpp>
Header <boost/date_time/time_duration.hpp>
Header <boost/date_time/time_facet.hpp>
Header <boost/date_time/time_formatting_streams.hpp>
Header <boost/date_time/time_iterator.hpp>
Header <boost/date_time/time_parsing.hpp>
Header <boost/date_time/time_resolution_traits.hpp>
Header <boost/date_time/time_system_counted.hpp>
Header <boost/date_time/time_system_split.hpp>
Header <boost/date_time/time_zone_base.hpp>
Header <boost/date_time/time_zone_names.hpp>
Header <boost/date_time/tz_db_base.hpp>
Header <boost/date_time/wrapping_int.hpp>
Header <boost/date_time/year_month_day.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;
  }
}

Time adjustment calculations based on machine

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

Provide workarounds related to the ctime header

namespace std {
}namespace boost {
  namespace date_time {
    struct c_time;
  }
}
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 };
  }
}
namespace boost {
  namespace date_time {
    template<typename T, typename calendar, typename duration_type_> class date;
  }
}
namespace boost {
  namespace date_time {
    template<typename date_type> class day_clock;
  }
}
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 };
  }
}
namespace boost {
  namespace date_time {
    template<typename duration_rep_traits> class date_duration;

    struct duration_traits_long;
    struct duration_traits_adapted;
  }
}
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;
  }
}
namespace boost {
  namespace date_time {
    template<typename date_type, typename CharT, 
             typename OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > 
      class date_facet;
    template<typename date_type, typename CharT, 
             typename InItrT = std::istreambuf_iterator<CharT, std::char_traits<CharT> > > 
      class date_input_facet;
  }
}
namespace boost {
  namespace date_time {
    template<typename charT> class simple_format;

    template<> class simple_format<wchar_t>;
  }
}
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;
  }
}
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;
  }
}
namespace boost {
  namespace date_time {
    template<typename date_type, typename CharT, 
             typename OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > 
      class date_generator_formatter;
  }
}
namespace boost {
  namespace date_time {
    template<typename date_type, typename charT> class date_generator_parser;
  }
}

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 &);
  }
}
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 };
  }
}
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;
  }
}

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 = 120, 
             short dst_length_minutes = 60> 
      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 };
  }
}
namespace boost {
  namespace date_time {
    template<typename date_type> class dst_day_calc_rule;
    template<typename spec> class day_calc_dst_rule;
  }
}

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 &);
  }
}
namespace boost {
  namespace date_time {
    template<typename date_type, typename charT> class format_date_parser;
    template<typename int_type, typename charT> 
      int_type fixed_string_to_int(std::istreambuf_iterator< charT > &, 
                                   std::istreambuf_iterator< charT > &, 
                                   parse_match_result< charT > &, 
                                   unsigned int, const charT &);
    template<typename int_type, typename charT> 
      int_type fixed_string_to_int(std::istreambuf_iterator< charT > &, 
                                   std::istreambuf_iterator< charT > &, 
                                   parse_match_result< charT > &, 
                                   unsigned int);
    template<typename int_type, typename charT> 
      int_type var_string_to_int(std::istreambuf_iterator< charT > &, 
                                 std::istreambuf_iterator< charT > &, 
                                 unsigned int);
  }
}
namespace boost {
  namespace date_time {
    template<typename ymd_type_, typename date_int_type_> 
      class gregorian_calendar_base;
  }
}
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 > &);
  }
}
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;
  }
}

Time adjustment calculations for local times

namespace boost {
  namespace date_time {
    template<typename time_duration_type, short hours, 
             unsigned short minutes = 0> 
      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();
  }
}
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;
  }
}

This file contains a high resolution time clock implementation.

namespace boost {
  namespace date_time {
    template<typename time_type> class microsec_clock;
  }
}
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;
  }
}

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;
  }
}
namespace boost {
  namespace date_time {
    template<typename CharT, 
             typename OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > 
      class period_formatter;
  }
}
namespace boost {
  namespace date_time {
    template<typename date_type, typename CharT> class period_parser;
  }
}
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 };
  }
}
namespace boost {
  namespace date_time {
    template<typename CharT, 
             typename OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > 
      class special_values_formatter;
  }
}
namespace boost {
  namespace date_time {
    template<typename date_type, typename charT> class special_values_parser;
  }
}
namespace boost {
  namespace date_time {
    template<typename InputT, typename OutputT> 
      std::basic_string< OutputT > 
      convert_string_type(const std::basic_string< InputT > &);
  }
}
namespace boost {
  namespace date_time {
    template<typename charT> struct parse_match_result;
    template<typename charT> struct string_parse_tree;
    template<typename charT> 
      std::basic_ostream< charT > & 
      operator<<(std::basic_ostream< charT > & os, 
                 parse_match_result< charT > & mr);
  }
}
namespace boost {
  namespace date_time {
    template<typename charT> 
      std::vector< std::basic_string< charT > > 
      gather_month_strings(const std::locale &, bool = true);
    template<typename charT> 
      std::vector< std::basic_string< charT > > 
      gather_weekday_strings(const std::locale &, bool = true);
  }
}

This file contains the interface for the time associated classes.

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

This file contains the interface for clock devices.

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

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 };
  }
}
namespace boost {
  namespace date_time {
    template<typename T, typename rep_type> class time_duration;
    template<typename base_duration, boost::int64_t frac_of_second> 
      class subsecond_duration;
  }
}
namespace boost {
  namespace date_time {
    template<typename CharT> struct time_formats;

    template<typename time_type, typename CharT, 
             typename OutItrT = std::ostreambuf_iterator<CharT, std::char_traits<CharT> > > 
      class time_facet;
    template<typename time_type, typename CharT, 
             typename InItrT = std::istreambuf_iterator<CharT, std::char_traits<CharT> > > 
      class time_input_facet;
  }
}
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;
  }
}
namespace boost {
  namespace date_time {
    template<typename time_type> class time_itr;
  }
}
namespace boost {
  namespace date_time {

    // computes exponential math like 2^8 => 256, only works with positive integers 
    template<typename int_type> 
      int_type power(int_type base, int_type exponent);
    template<typename time_duration, typename char_type> 
      time_duration 
      str_from_delimited_time_duration(const std::basic_string< char_type > &);
    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[.fff...] (eg: 120259.123 is 12 hours, 2 min, 59 seconds, 123000 microseconds). 
    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);
  }
}
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< 1300)) 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);
  }
}
namespace boost {
  namespace date_time {
    template<typename config> struct counted_time_rep;

    template<typename time_rep> class counted_time_system;
  }
}
namespace boost {
  namespace date_time {
    template<typename config, boost::int32_t ticks_per_second> 
      class split_timedate_system;
  }
}
namespace boost {
  namespace date_time {
    template<typename time_type, typename CharT> class time_zone_base;
    template<typename time_duration_type> class dst_adjustment_offsets;
  }
}
namespace boost {
  namespace date_time {
    template<typename CharT> struct default_zone_names;

    template<typename CharT> class time_zone_names_base;
  }
}
namespace boost {
  namespace date_time {
    class data_not_accessible;
    class bad_field_count;
    template<typename time_zone_type, typename rule_type> class tz_db_base;
  }
}
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;
  }
}
namespace boost {
  namespace date_time {
    template<typename YearType, typename MonthType, typename DayType> 
      struct year_month_day_base;
  }
}

Gregorian Reference

namespace boost {
  namespace gregorian {

    // Converts a date to a tm struct. Throws out_of_range exception if date is a special value. 
    std::tm to_tm(const date & d);

    // Converts a tm structure into a date dropping the any time values. 
    date date_from_tm(const std::tm & datetm);
  }
}
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);
  }
}
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. 
  }
}
namespace boost {
  namespace gregorian {
    class date;
  }
}
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. 
  }
}
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. 
  }
}
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. 
  }
}
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;
  }
}
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);
  }
}
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_SERIALIZATION_SPLIT_FREE(::boost::gregorian::date_duration);
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;
  }
}
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. 
  }
}
namespace boost {
  namespace gregorian {
    typedef date_time::year_month_day_base< greg_year, greg_month, greg_day > greg_year_month_day;
  }
}

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.

namespace boost {
  namespace gregorian {
    typedef boost::date_time::period_formatter< wchar_t > wperiod_formatter;
    typedef boost::date_time::period_formatter< char > period_formatter;
    typedef boost::date_time::date_facet< date, wchar_t > wdate_facet;
    typedef boost::date_time::date_facet< date, char > date_facet;
    typedef boost::date_time::period_parser< date, char > period_parser;
    typedef boost::date_time::period_parser< date, wchar_t > wperiod_parser;
    typedef boost::date_time::special_values_formatter< char > special_values_formatter;
    typedef boost::date_time::special_values_formatter< wchar_t > wspecial_values_formatter;
    typedef boost::date_time::special_values_parser< date, char > special_values_parser;
    typedef boost::date_time::special_values_parser< date, wchar_t > wspecial_values_parser;
    typedef boost::date_time::date_input_facet< date, char > date_input_facet;
    typedef boost::date_time::date_input_facet< date, wchar_t > wdate_input_facet;
    template<typename CharT, typename TraitsT> 
      std::basic_ostream< CharT, TraitsT > & 
      operator<&l