Date Time Reference
Functor to iterate a fixed number of days. date_type::duration_type duration_typeconst date_type & duration_typeconst date_type & int Provides calculation to find next nth month given a date. 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. date_type::duration_type date_type::calendar_type cal_type::ymd_type cal_type::day_type duration_typeconst date_type & duration_typeconst date_type &Returns a negative duration_type. int Functor to iterate a over weeks. date_type::duration_type date_type::calendar_type duration_typeconst date_type & duration_typeconst date_type & int Functor to iterate by a year adjusting for leap years. date_type::duration_type duration_typeconst date_type & duration_typeconst date_type & int
Time adjustment calculations based on machine Adjust to / from utc using the C API. Warning!!! This class assumes that timezone settings of the machine are correct. This can be a very dangerous assumption. time_type::time_duration_type time_type::date_type date_type::duration_type time_typeconst time_type &Convert a utc time to local time.
Provide workarounds related to the ctime header Provides a uniform interface to some 'ctime' functions. Provides a uniform interface to some ctime functions and their '_r' counterparts. The '_r' functions require a pointer to a user created std::tm struct whereas the regular functions use a staticly created struct and return a pointer to that. These wrapper functions require the user to create a std::tm struct and send in a pointer to it. This struct may be used to store the resulting time. The returned pointer may or may not point to this struct, however, it will point to the result of the corresponding function. All functions do proper checking of the C function results and throw exceptions on error. Therefore the functions will never return NULL. std::tm *const std::time_t *std::tm *requires a pointer to a user created std::tm struct std::tm *const std::time_t *std::tm *requires a pointer to a user created std::tm struct std::tm *const std::time_t *std::tm *requires a pointer to a user created std::tm struct std::tm *const std::time_t *std::tm *requires a pointer to a user created std::tm struct
A template to specify a constrained basic value type. 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. value_policies::value_type value_typeCoerce into the representation type. value_type constrained_value &value_type value_type maxReturn the max allowed value (traits method) value_type minReturn the min allowed value (traits method) voidvalue_type Template to shortcut the constrained_value policy creation process. exception_type std::out_of_range rep_type rep_type min rep_type max voidrep_typerep_typeviolation_enum Represent a min or max violation type.
boost::less_than_comparable< T, boost::equality_comparable< T > >Representation of timepoint at the one day level resolution. 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.TheoryThis 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. T calendar calendar::date_traits_type duration_type_ calendar::year_type calendar::month_type calendar::day_type calendar::ymd_type calendar::date_rep_type calendar::date_int_type calendar::day_of_week_type year_type month_type day_type day_of_week_type ymd_type boolconst date_type & boolconst date_type & boolcheck to see if date is a special value boolcheck to see if date is not a value boolcheck to see if date is one of the infinity values boolcheck to see if date is greater than all possible dates boolcheck to see if date is greater than all possible dates special_valuesreturn as a special value or a not_special if a normal date duration_typeconst date_type & date_typeconst duration_type & date_typeconst duration_type & date_rep_type date_typeconst duration_type & date_typeconst duration_type & year_typemonth_typeday_type const ymd_type & date_int_typeThis 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_rep_type
A clock providing day level services based on C time_t capabilities. 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. date_type::ymd_type date_typeGet the local day as a date type. date_type::ymd_typeGet the local day as a ymd_type. date_type::ymd_typeGet the current day in universal date as a ymd_type. date_typeGet the UTC day as a date type. ::std::tm *std::tm & ::std::tm *std::tm &
An enumeration of weekday names. =1Simple enum to allow for nice programming with Jan, Feb, etc.
boost::less_than_comparable1< date_duration< duration_rep_traits >, boost::equality_comparable1< date_duration< duration_rep_traits >, boost::addable1< date_duration< duration_rep_traits >, boost::subtractable1< date_duration< duration_rep_traits >, boost::dividable2< date_duration< duration_rep_traits >, int > > > > >Duration type with date level resolution. duration_rep_traits::int_type duration_rep_traits::impl_type duration_repreturns days_ as it's instantiated type - used for streaming special_values bool duration_rep_typereturns days as value, not object. boolconst date_duration &Equality. boolconst date_duration &Less. date_duration &const date_duration &Subtract another duration – result is signed. date_duration &const date_duration &Add a duration – result is signed. date_durationunary- Allows for dd = -date_duration(2); -> dd == -2 date_duration &intDivision operations on a duration with an integer. boolreturn sign information duration_repConstruct from a day count. special_valuesconstruct from special_values - only works when instantiated with duration_traits_adapted const date_duration< duration_rep_traits > &Construct from another date_duration (Copy Constructor) date_durationReturns the smallest duration – used by to calculate 'end'. Struct for instantiating date_duration WITH special values functionality. Allows for transparent implementation of either date_duration<long> or date_duration<int_adapter<long> > long boost::date_time::int_adapter< long > int_typeimpl_type 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> > long long int_typeimpl_type
additional duration type that represents a logical month 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. int_rep duration_typeconst date_type &returns a negative duration duration_typeconst date_type & boolconst months_type & boolconst months_type & months_typeconst months_type & months_type &const months_type & months_typeconst months_type & months_type &const months_type & months_typeconst int_type months_type &const int_type months_typeconst int_type months_type &const int_type months_typeconst years_type & months_type &const years_type & months_typeconst years_type & months_type &const years_type & int_rep special_values boost::date_time::date_duration< duration_config >Additional duration type that represents a number of n*7 days. typename duration_config::impl_type special_values additional duration type that represents a logical year 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). int_rep duration_typeconst date_type &returns a negative duration duration_typeconst date_type & boolconst years_type & boolconst years_type & years_typeconst years_type & years_type &const years_type & years_typeconst years_type & years_type &const years_type & years_typeconst int_type years_type &const int_type years_typeconst int_type years_type &const int_type months_typeconst months_type & months_typeconst months_type & int_rep special_values class BOOST_SYMBOL_VISIBLE
facetClass that provides format based I/O facet for date types.This class allows the formatting of dates by using format string. Format strings are: A => long_weekday_format - Full name Ex: Tuesday a => short_weekday_format - Three letter abbreviation Ex: Tue B => long_month_format - Full name Ex: October b => short_month_format - Three letter abbreviation Ex: Oct x => standard_format_specifier - defined by the locale Y-b-d => default_date_format - YYYY-Mon-dd Default month format == b Default weekday format == a date_type::duration_type date_type::day_of_week_type date_type::day_type date_type::month_type boost::date_time::period< date_type, duration_type > std::basic_string< CharT > CharT boost::date_time::period_formatter< CharT > boost::date_time::special_values_formatter< CharT > std::vector< std::basic_string< CharT > > date_generator_formatter< date_type, CharT > partial_date< date_type > nth_kday_of_month< date_type > first_kday_of_month< date_type > last_kday_of_month< date_type > first_kday_after< date_type > first_kday_before< date_type > const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type std::locale::id std::locale::id &void voidconst char_type *const void void voidconst char_type *const voidconst char_type *const voidperiod_formatter_type voidconst special_values_formatter_type & voidconst input_collection_type & voidconst input_collection_type & voidconst input_collection_type & voidconst input_collection_type & voidconst input_collection_type &typename date_gen_formatter_type::phrase_elementsdate_gen_formatter_type::first OutItrTOutItrTstd::ios_base &char_typeconst date_type & OutItrTOutItrTstd::ios_base &char_typeconst duration_type & OutItrTOutItrTstd::ios_base &char_typeconst month_type & OutItrTOutItrTstd::ios_base &char_typeconst day_type &puts the day of month OutItrTOutItrTstd::ios_base &char_typeconst day_of_week_type & OutItrTOutItrTstd::ios_base &char_typeconst period_type & OutItrTOutItrTstd::ios_base &char_typeconst partial_date_type & OutItrTOutItrTstd::ios_base &char_typeconst nth_kday_type & OutItrTOutItrTstd::ios_base &char_typeconst first_kday_type & OutItrTOutItrTstd::ios_base &char_typeconst last_kday_type & OutItrTOutItrTstd::ios_base &char_typeconst kday_before_type & OutItrTOutItrTstd::ios_base &char_typeconst kday_after_type & ::size_t0 const char_type *const input_collection_type &::size_t0 const char_type *period_formatter_typeperiod_formatter_type()special_values_formatter_typespecial_values_formatter_type()date_gen_formatter_typedate_gen_formatter_type()::size_t0 OutItrTOutItrTstd::ios_base &char_typeconst boost::date_time::special_values OutItrTOutItrTstd::ios_base &char_typeconst tm &string_type facetInput facet. date_type::duration_type date_type::day_of_week_type date_type::day_type date_type::month_type date_type::year_type boost::date_time::period< date_type, duration_type > std::basic_string< CharT > CharT boost::date_time::period_parser< date_type, CharT > boost::date_time::special_values_parser< date_type, CharT > std::vector< std::basic_string< CharT > > format_date_parser< date_type, CharT > date_generator_parser< date_type, CharT > partial_date< date_type > nth_kday_of_month< date_type > first_kday_of_month< date_type > last_kday_of_month< date_type > first_kday_after< date_type > first_kday_before< date_type > const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type std::locale::id voidconst char_type *const void void voidconst char_type *const voidconst char_type *const voidconst char_type *const voidperiod_parser_type voidconst input_collection_type & voidconst input_collection_type & voidconst input_collection_type & voidconst input_collection_type & voidconst input_collection_type & voidconst string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type & voidspecial_values_parser_type InItrTInItrT &InItrT &std::ios_base &date_type & InItrTInItrT &InItrT &std::ios_base &month_type & InItrTInItrT &InItrT &std::ios_base &day_of_week_type & InItrTInItrT &InItrT &std::ios_base &day_type &Expects 1 or 2 digit day range: 1-31. InItrTInItrT &InItrT &std::ios_base &year_type & InItrTInItrT &InItrT &std::ios_base &duration_type & InItrTInItrT &InItrT &std::ios_base &period_type & InItrTInItrT &InItrT &std::ios_base &nth_kday_type & InItrTInItrT &InItrT &std::ios_base &partial_date_type & InItrTInItrT &InItrT &std::ios_base &first_kday_type & InItrTInItrT &InItrT &std::ios_base &last_kday_type & InItrTInItrT &InItrT &std::ios_base &kday_before_type & InItrTInItrT &InItrT &std::ios_base &kday_after_type & ::size_t0 const string_type &::size_t0 const string_type &const format_date_parser_type &const special_values_parser_type &const period_parser_type &const date_gen_parser_type &::size_t0
Class to provide simple basic formatting rules. const charT *String used printed is date is invalid. const charT *String used to for positive infinity value. const charT *String used to for positive infinity value. month_format_specDescribe month format. ymd_order_spec boolThis format uses '-' to separate date elements. charTChar to sep? charTchar between year-month charTChar to separate month-day. charTchar between date-hours charTchar between hour and minute charTchar for second wchar_tSpecialization of formmating rules for wchar_t. const wchar_t *String used printed is date is invalid. const wchar_t *String used to for positive infinity value. const wchar_t *String used to for positive infinity value. month_format_specDescribe month format. ymd_order_spec boolThis format uses '-' to separate date elements. wchar_tChar to sep? wchar_tchar between year-month wchar_tChar to separate month-day. wchar_tchar between date-hours wchar_tchar between hour and minute wchar_tchar for second
Convert a date to string using format policies. std::stringdate_typeConvert to a date to standard string using format policies. string_typedate_typeConvert to a date to standard string using format policies. Formats a month as as string into an ostream. std::ostream &const month_type &std::ostream &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. ostream_type &const month_type &ostream_type &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. Convert ymd to a standard string formatting policies. std::stringymd_typeConvert 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::basic_string< charT >ymd_typeConvert 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
Convert a date to string using format policies. std::basic_ostream< charT > date_type::ymd_type voidconst date_type &ostream_type &const facet_type &Put date into an ostream. voidconst date_type &ostream_type &Put date into an ostream. Formats a month as as string into an ostream. facet_type::month_type std::basic_ostream< charT > voidconst month_type &ostream_type &const facet_type &Formats a month as as string into an output iterator. Formats a weekday. facet_type::month_type std::basic_ostream< charT > voidconst weekday_type &ostream_type &const facet_type &boolFormats a month as as string into an output iterator. Convert ymd to a standard string formatting policies. ymd_type::month_type ostream_month_formatter< facet_type, charT > std::basic_ostream< charT > std::basic_string< charT > voidymd_typeostream_type &const facet_type &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
Formats date_generators for output. Formatting of date_generators follows specific orders for the various types of date_generators. partial_date => "dd Month" nth_day_of_the_week_in_month => "nth weekday of month" first_day_of_the_week_in_month => "first weekday of month" last_day_of_the_week_in_month => "last weekday of month" first_day_of_the_week_after => "weekday after" first_day_of_the_week_before => "weekday before" While the order of the elements in these phrases cannot be changed, the elements themselves can be. Weekday and Month get their formats and names from the date_facet. The remaining elements are stored in the date_generator_formatter and can be customized upon construction or via a member function. The default elements are those shown in the examples above. =0 partial_date< date_type > nth_kday_of_month< date_type > first_kday_of_month< date_type > last_kday_of_month< date_type > first_kday_after< date_type > first_kday_before< date_type > CharT std::basic_string< char_type > std::vector< string_type > const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type voidconst collection_type &phrase_elementsfirstReplace the set of phrase elements with those contained in new_strings. The order of the strings in the given collection is important. They must follow: first, second, third, fourth, fifth, last, before, after, of. It is not necessary to send in a complete set if only a few elements are to be replaced as long as the correct beg_pos is used.Ex: To keep the default first through fifth elements, but replace the rest with a collection of: "final", "prior", "following", "in". The beg_pos of date_generator_formatter::last would be used. OutItrTOutItrTstd::ios_base &CharTconst partial_date_type &const facet_type &Put a partial_date => "dd Month". OutItrTOutItrTstd::ios_base &CharTconst nth_kday_type &const facet_type &Put an nth_day_of_the_week_in_month => "nth weekday of month". OutItrTOutItrTstd::ios_base &CharTconst first_kday_type &const facet_type &Put a first_day_of_the_week_in_month => "first weekday of month". OutItrTOutItrTstd::ios_base &CharTconst last_kday_type &const facet_type &Put a last_day_of_the_week_in_month => "last weekday of month". OutItrTOutItrTstd::ios_base &CharTconst kday_before_type &const facet_type &Put a first_day_of_the_week_before => "weekday before". OutItrTOutItrTstd::ios_base &CharTconst kday_after_type &const facet_type &Put a first_day_of_the_week_after => "weekday after". Default format elements used. const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &Constructor that allows for a custom set of phrase elements. OutItrTOutItrTconst string_type &helper function to put the various member string into stream
Class for date_generator parsing. The elements of a date_generator "phrase" are parsed from the input stream in a particular order. All elements are required and the order in which they appear cannot change, however, the elements themselves can be changed. The default elements and their order are as follows: partial_date => "dd Month" nth_day_of_the_week_in_month => "nth weekday of month" first_day_of_the_week_in_month => "first weekday of month" last_day_of_the_week_in_month => "last weekday of month" first_day_of_the_week_after => "weekday after" first_day_of_the_week_before => "weekday before" Weekday and Month names and formats are handled via the date_input_facet. =0 std::basic_string< charT > std::istreambuf_iterator< charT > date_type::month_type date_type::day_of_week_type date_type::day_type string_parse_tree< charT > parse_tree_type::parse_match_result_type std::vector< std::basic_string< charT > > partial_date< date_type > nth_kday_of_month< date_type > first_kday_of_month< date_type > last_kday_of_month< date_type > first_kday_after< date_type > first_kday_before< date_type > charT const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type voidconst string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &Replace strings that determine nth week for generator. voidconst collection_type & partial_date_typestream_itr_type &stream_itr_type &std::ios_base &const facet_type &returns partial_date parsed from stream nth_kday_typestream_itr_type &stream_itr_type &std::ios_base &const facet_type &returns nth_kday_of_week parsed from stream first_kday_typestream_itr_type &stream_itr_type &std::ios_base &const facet_type &returns first_kday_of_week parsed from stream last_kday_typestream_itr_type &stream_itr_type &std::ios_base &const facet_type &returns last_kday_of_week parsed from stream kday_before_typestream_itr_type &stream_itr_type &std::ios_base &const facet_type &returns first_kday_of_week parsed from stream kday_after_typestream_itr_type &stream_itr_type &std::ios_base &const facet_type &returns first_kday_of_week parsed from stream Creates a date_generator_parser with the default set of "element_strings". const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &const string_type &Creates a date_generator_parser using a user defined set of element strings. voidstream_itr_type &stream_itr_type &typename date_generator_parser::phrase_elementsExtracts phrase element from input. Throws ios_base::failure on error.
Definition and implementation of date algorithm templates Calculate something like "First Sunday after Jan 1,2002. 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)); date_type::calendar_type calendar_type::day_of_week_type date_type::duration_type date_typedate_typeReturn next kday given. day_of_week_type day_of_week_type Calculate something like "First Sunday before Jan 1,2002. 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)); date_type::calendar_type calendar_type::day_of_week_type date_type::duration_type date_typedate_typeReturn next kday given. day_of_week_type day_of_week_type boost::date_time::year_based_generator< date_type >Useful generator functor for finding holidays and daylight savings. Similar to nth_kday_of_month, but requires less paramters date_type::calendar_type calendar_type::day_of_week_type calendar_type::month_type calendar_type::year_type date_type::duration_type date_typeyear_typeReturn a concrete date when provided with a year specific year. month_type day_of_week_type std::stringReturns string suitable for use in POSIX time zone string. Returns a string formatted as "M4.1.0" ==> 1st Sunday in April. day_of_week_typeThe day of week, eg: Sunday, Monday, etc month_typeThe month of the year, eg: Jan, Feb, Mar, etc Specify the first 'Sunday' in 'April' spec. boost::date_time::year_based_generator< date_type >Calculate something like Last Sunday of January. 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. date_type::calendar_type calendar_type::day_of_week_type calendar_type::month_type calendar_type::year_type date_type::duration_type date_typeyear_typeReturn a concrete date when provided with a year specific year. month_type day_of_week_type std::stringReturns string suitable for use in POSIX time zone string. Returns a string formatted as "M4.5.0" ==> last Sunday in April. day_of_week_typeThe day of week, eg: Sunday, Monday, etc month_typeThe month of the year, eg: Jan, Feb, Mar, etc Specify the date spec like last 'Sunday' in 'April' spec. boost::date_time::year_based_generator< date_type >Useful generator functor for finding holidays. 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. =1 date_type::calendar_type calendar_type::day_of_week_type calendar_type::month_type calendar_type::year_type date_type::duration_type date_typeyear_typeReturn a concrete date when provided with a year specific year. month_type week_num day_of_week_type const char * std::stringReturns string suitable for use in POSIX time zone string. Returns a string formatted as "M4.3.0" ==> 3rd Sunday in April. week_numday_of_week_typemonth_type boost::date_time::year_based_generator< date_type >Generates a date by applying the year to the given month and day. 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 date_type::calendar_type calendar_type::day_type calendar_type::month_type calendar_type::year_type date_type::duration_type duration_type::duration_rep date_typeyear_typeReturn 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_typeyear_type boolconst partial_date & boolconst partial_date & month_type day_type std::stringReturns string suitable for use in POSIX time zone string. Returns string formatted with up to 3 digits: Jan-01 == "0" Feb-29 == "58" Dec-31 == "365" day_typemonth_type duration_repPartial 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 Base class for all generators that take a year and produce a date. This class is a base class for polymorphic function objects that take a year and produce a concrete date. date_type::calendar_type calendar_type::year_type date_typeyear_type std::stringReturns a string for use in a POSIX time_zone string. BOOST_DATE_TIME_DECL const char *intReturns nth arg as string. 1 -> "first", 2 -> "second", max is 5. date_type::duration_typeconst date_type &const weekday_type &Calculates the number of days until the next weekday. 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 date_type::duration_typeconst date_type &const weekday_type &Calculates the number of days since the previous weekday. 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. date_typeconst date_type &const weekday_type &Generates a date object representing the date of the following weekday from the given date. 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. date_typeconst date_type &const weekday_type &Generates a date object representing the date of the previous weekday from the given date. 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.
boost::date_time::date_itr_base< date_type >Overrides the base date iterator providing hook for functors. date_type::duration_type date_typeint1 duration_typeconst date_type & duration_typeconst date_type & Base date iterator type. 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 Parametersdate_typeThe date_type is a concrete date_type. The date_type must define a duration_type and a calendar_type. date_type::duration_type date_type std::input_iterator_tag date_itr_base & date_itr_base & duration_typeconst date_type & duration_typeconst date_type & date_type date_type * boolconst date_type & boolconst date_type & boolconst date_type & boolconst date_type & boolconst date_type & boolconst date_type & date_type An iterator over dates with varying resolution (day, week, month, year, etc)
boost::date_time::date_names_put< Config, charT, OutputIterator >A date name output facet that takes an array of char* to define strings. OutputIterator Config::month_enum Config::weekday_enum Config::special_value_enum const charT *const * const charT *const * const charT *const * const charT *const * const charT *const * const charT *constconst charT *constconst charT *constconst charT *constconst charT *constcharT'-'ymd_order_specymd_order_isomonth_format_specmonth_as_short_string voiditer_type &month_enumGeneric facet that takes array of chars. voiditer_type &month_enumLong month names. voiditer_type &special_value_enumSpecial values names. voiditer_type &weekday_enum voiditer_type &weekday_enum voiditer_type &char between year-month voiditer_type &Char to separate month-day. ymd_order_specSet the date ordering. month_format_specSet the date ordering. facetOutput facet base class for gregorian dates. 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). OutputIterator Config::month_type Config::month_enum Config::weekday_enum Config::special_value_enum std::basic_string< charT > charT const char_type const char_type std::locale::idGenerate storage location for a std::locale::id. std::locale::id &void voiditer_type &special_value_enum voiditer_type &month_enum voiditer_type &month_enum voiditer_type &weekday_enum voiditer_type &weekday_enum bool voiditer_type & voiditer_type &char between year-month voiditer_type &Char to separate month-day. ymd_order_specDetermines the order to put the date elements. month_format_specDetermines if month is displayed as integer, short or long string. voiditer_type &month_enumDefault facet implementation uses month_type defaults. voiditer_type &month_enumDefault facet implementation uses month_type defaults. voiditer_type &special_value_enumDefault facet implementation for special value types. voiditer_type &weekday_enum voiditer_type &weekday_enum bool voiditer_type & voiditer_type &char between year-month voiditer_type &Char to separate month-day. ymd_order_specDefault for date order. month_format_specDefault month format. voiditer_type &const charT *const voiditer_type &const string_type &
std::stringstd::stringA function to replace the std::transform( , , ,tolower) construct. This function simply takes a string, and changes all the characters in that string to lowercase (according to the default system locale). In the event that a compiler does not support locales, the old C style tolower() is used. unsigned shortstd::string const &Helper function for parse_date. shortconst charT *const *const charT *const *shortconst std::basic_string< charT > &Find index of a string in either of 2 arrays. find_match searches both arrays for a match to 's'. Both arrays must contain 'size' elements. The index of the match is returned. If no match is found, 'size' is returned. Ex. "Jan" returns 0, "Dec" returns 11, "Tue" returns 2. 'size' can be sent in with: (greg_month::max)() (which 12), (greg_weekday::max)() + 1 (which is 7) or date_time::NumSpecialValues date_typeconst std::string &intymd_order_isoGeneric function to parse a delimited date (eg: 2002-02-10) Accepted formats are: "2003-02-10" or " 2003-Feb-10" or "2003-Feburary-10" The order in which the Month, Day, & Year appear in the argument string can be accomodated by passing in the appropriate ymd_order_spec date_typeconst std::string &Generic function to parse undelimited date (eg: 20020201) date_typeiterator_type &iterator_type const &charHelper function for 'date gregorian::from_stream()'. Creates a string from the iterators that reference the begining & end of a char[] or string. All elements are used in output string date_typeiterator_type &iterator_type const &std::string const &Helper function for 'date gregorian::from_stream()'. Returns the first string found in the stream referenced by the begining & end iterators date_typeiterator_type &iterator_type const &wchar_tHelper function for 'date gregorian::from_stream()'. Creates a string from the iterators that reference the begining & end of a wstring. All elements are used in output string date_typeiterator_type &iterator_type const &std::wstring const &Helper function for 'date gregorian::from_stream()'. Creates a string from the first wstring found in the stream referenced by the begining & end iterators period< date_type, typename date_type::duration_type >const std::basic_string< charT > &function called by wrapper functions: date_period_from_(w)string()
Contains template class to provide static dst rule calculations Compile-time configurable daylight savings time calculation engine. date_type::year_type date_type::calendar_type dst_calculator< date_type, time_duration_type > time_is_dst_resultconst date_type &const time_duration_type &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. booldate_type time_duration_typeThe time of day for the dst transition (eg: typically 01:00:00 or 02:00:00) date_typeyear_type date_typeyear_type Dynamic class used to caluclate dst transition information. time_duration_type_ date_type_ time_is_dst_resultconst time_duration_type &Time offset in the day for the local time unsigned intLocal day offset for start of dst longNumber of minutes to adjust clock forward 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. time_is_dst_resultconst time_duration_type &Time offset in the day for the local time unsigned intLocal time of day for end of dst longCheck 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. time_is_dst_resultconst date_type &The day to check for dst const time_duration_type &Time offset within the day to check const date_type &Starting day of dst for the given locality const time_duration_type &Time offset within day for dst boundary const date_type &Ending day of dst for the given locality const time_duration_type &Time offset within day given in dst for dst boundary const time_duration_type &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. time_is_dst_resultconst date_type &The day to check for dst const time_duration_type &Time offset within the day to check const date_type &Starting day of dst for the given locality unsigned intOffset within day for dst boundary (eg 120 for US which is 02:00:00) const date_type &Ending day of dst for the given locality unsigned intOffset within day given in dst for dst boundary (eg 120 for US which is 02:00:00) longLength of dst adjusment (eg: 60 for US) 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. Used for local time adjustments in places that don't use dst. time_duration_type_ date_type_ time_is_dst_resultconst date_type &const time_duration_type &Calculates if the given local time is dst or not. time_is_dst_resultconst date_type &const time_duration_type &Calculates if the given utc time is in dst. booldate_type time_duration_type Depricated: Class to calculate dst boundaries for US time zones. time_duration_type_ date_type_ date_type::year_type date_type::calendar_type date_time::last_kday_of_month< date_type > date_time::first_kday_of_month< date_type > date_time::nth_kday_of_month< date_type > dst_calculator< date_type, time_duration_type > time_is_dst_resultconst date_type &const time_duration_type &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. booldate_type date_typeyear_type date_typeyear_type time_duration_type
boost::date_time::dst_day_calc_rule< spec::date_type >Canonical form for a class that provides day rule calculation. This class is used to generate specific sets of dst rules spec::date_type date_type::year_type spec::start_rule spec::end_rule date_typeyear_type std::string date_typeyear_type std::string start_ruleend_rule Defines base interface for calculating start and end date of daylight savings. date_type::year_type date_typeyear_type std::string date_typeyear_type std::string
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. TimeTconst FileTimeT &Create a time object from an initialized FILETIME struct. Create a time object from an initialized FILETIME struct. A FILETIME struct holds 100-nanosecond units (0.0000001). When built with microsecond resolution the file_time's sub second value will be truncated. Nanosecond resolution has no truncation.The function is templated on the FILETIME type, so that it can be used with both native FILETIME and the ad-hoc boost::detail::winapi::FILETIME_ type.
Class with generic date parsing using a format string. The following is the set of recognized format specifiers a - Short weekday name A - Long weekday name b - Abbreviated month name B - Full month name d - Day of the month as decimal 01 to 31 j - Day of year as decimal from 001 to 366 m - Month name as a decimal 01 to 12 U - Week number 00 to 53 with first Sunday as the first day of week 1? w - Weekday as decimal number 0 to 6 where Sunday == 0 W - Week number 00 to 53 where Monday is first day of week 1 x - facet default date representation y - Year without the century - eg: 04 for 2004 Y - Year with century The weekday specifiers (a and A) do not add to the date construction, but they provide a way to skip over the weekday names for formats that provide them.todo – Another interesting feature that this approach could provide is an option to fill in any missing fields with the current values from the clock. So if you have m-d the parser would detect the missing year value and fill it in using the clock.todo – What to do with the x. x in the classic facet is just bad... std::basic_string< charT > std::basic_istringstream< charT > std::istreambuf_iterator< charT > string_type::const_iterator date_type::year_type date_type::month_type date_type::day_type date_type::duration_type date_type::day_of_week_type date_type::day_of_year_type string_parse_tree< charT > parse_tree_type::parse_match_result_type std::vector< std::basic_string< charT > > string_type voidstring_type voidconst input_collection_type & voidconst input_collection_type & voidconst input_collection_type & voidconst input_collection_type & date_typeconst string_type &const string_type &const special_values_parser< date_type, charT > & date_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &const special_values_parser< date_type, charT > & date_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &string_typeconst special_values_parser< date_type, charT > &Of all the objects that the format_date_parser can parse, only a date can be a special value. Therefore, only parse_date checks for special_values. month_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &string_typeThrows bad_month if unable to parse. month_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &string_typematch_results &Throws bad_month if unable to parse. day_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &Expects 1 or 2 digits 1-31. Throws bad_day_of_month if unable to parse. day_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &Expects 2 digits 01-31. Throws bad_day_of_month if unable to parse. day_of_week_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &string_type day_of_week_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &string_typematch_results & year_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &string_typethrows bad_year if unable to parse year_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &string_typematch_results &throws bad_year if unable to parse const string_type &const input_collection_type &const input_collection_type &const input_collection_type &const input_collection_type & const string_type &const std::locale & const format_date_parser< date_type, charT > & int_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &parse_match_result< charT > &unsigned intconst charT &Helper function for parsing fixed length strings into integers. Will consume 'length' number of characters from stream. Consumed character are transfered to parse_match_result struct. Returns '-1' if no number can be parsed or incorrect number of digits in stream. int_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &parse_match_result< charT > &unsigned intHelper function for parsing fixed length strings into integers. Will consume 'length' number of characters from stream. Consumed character are transfered to parse_match_result struct. Returns '-1' if no number can be parsed or incorrect number of digits in stream. int_typestd::istreambuf_iterator< charT > &const std::istreambuf_iterator< charT > &unsigned intHelper function for parsing varied length strings into integers. Will consume 'max_length' characters from stream only if those characters are digits. Returns '-1' if no number can be parsed. Will not parse a number preceeded by a '+' or '-'.
An implementation of the Gregorian calendar. 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. define a type a date split into components ymd_type_ define a type for representing months ymd_type::month_type define a type for representing days ymd_type::day_type Type to hold a stand alone year value (eg: 2002) ymd_type::year_type Define the integer type to use for internal calculations. date_int_type_ unsigned shortconst ymd_type & intconst ymd_type & date_int_typeconst ymd_type & date_int_typeconst ymd_type & date_int_typeconst ymd_type & ymd_typedate_int_type ymd_typedate_int_type ymd_typedate_int_type boolyear_type unsigned shortyear_typemonth_type ymd_type unsigned short
Adapter to create integer types with +-infinity, and not a value. 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_type_ bool bool bool bool bool boolconst int_adapter & boolconst int & boolconst int_adapter & boolconst int & boolconst int_adapter & boolconst int & boolconst int_adapter & int_type special_valuesReturns either special value type or is_not_special. int_adapterconst int_adapter< rhs_type > &Operator allows for adding dissimilar int_adapter types. The return type will match that of the the calling object's type int_adapterconst int_type int_adapterconst int_adapter< rhs_type > &Operator allows for subtracting dissimilar int_adapter types. The return type will match that of the the calling object's type int_adapterconst int_type int_adapterconst int_adapter & int_adapterconst intProvided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results. int_adapterconst int_adapter & int_adapterconst intProvided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results. int_adapterconst int_adapter & int_adapterconst intProvided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results. int_type bool const int_adapter const int_adapter const int_adapter int_adapter max int_adapter min int_adapterspecial_values boolint_type boolint_type boolint_type boolint_type special_valuesint_typeReturns either special value type or is_not_special. int_type intconst int_adapter &returns -1, 0, 1, or 2 if 'this' is <, ==, >, or 'nan comparison' rhs int_adapterconst int_adapter &Assumes at least 'this' or 'rhs' is a special value. int_adapterconst int &Assumes 'this' is a special value. std::basic_ostream< charT, traits > &std::basic_ostream< charT, traits > &const int_adapter< int_type > &Expected output is either a numeric representation or a special values representation. Ex. "12", "+infinity", "not-a-number", etc.
boost::date_time::iso_format_base< charT >Extended format uses seperators YYYY-MM-DD. boolExtended format needs char separators. boost::date_time::iso_format_base< charT >Format description for iso normal YYYYMMDD. boolThe ios standard format doesn't use char separators. Class to provide common iso formatting spec. month_format_specDescribe month format – its an integer in iso format. const charT *String used printed is date is invalid. const charT *String used to for positive infinity value. const charT *String used to for positive infinity value. charTISO char for a year – used in durations. charTISO char for a month. charTISO char for a day. charTchar for minute charTchar for minute charTchar for second charTISO char for a period. charTUsed in time in mixed strings to set start of time. charTUsed in mixed strings to identify start of a week number. charTSeparators for periods. charTSeparator for hh:mm:ss. charTPreferred Separator for hh:mm:ss,decimal_fraction. boolcharT boolcharT boolcharT charT wchar_tClass to provide common iso formatting spec. month_format_specDescribe month format – its an integer in iso format. const wchar_t *String used printed is date is invalid. const wchar_t *String used to for positive infinity value. const wchar_t *String used to for positive infinity value. wchar_tISO char for a year – used in durations. wchar_tISO char for a month. wchar_tISO char for a day. wchar_tchar for minute wchar_tchar for minute wchar_tchar for second wchar_tISO char for a period. wchar_tUsed in time in mixed strings to set start of time. wchar_tUsed in mixed strings to identify start of a week number. wchar_tSeparators for periods. wchar_tSeparator for hh:mm:ss. wchar_tPreferred Separator for hh:mm:ss,decimal_fraction. boolwchar_t boolwchar_t boolwchar_t wchar_t
Time adjustment calculations for local times dst_rulesAllow sliding utc adjustment with fixed dst rules. time_type::time_duration_type time_type::date_type time_duration_typeboolPresumes local time. time_duration_type Template that simplifies the creation of local time calculator. Use this template to create the timezone to utc convertors as required.This class will also work for other regions that don't use dst and have a utc offset which is an integral number of hours.Template Parameters -time_type – Time class to use -utc_offset – Number hours local time is adjust from utc -use_dst – true (default) if region uses dst, false otherwise For example: //eastern timezone is utc-5 typedef date_time::local_adjustor<ptime, -5, us_dst> us_eastern; typedef date_time::local_adjustor<ptime, -6, us_dst> us_central; typedef date_time::local_adjustor<ptime, -7, us_dst> us_mountain; typedef date_time::local_adjustor<ptime, -8, us_dst> us_pacific; typedef date_time::local_adjustor<ptime, -7, no_dst> us_arizona; time_type::time_duration_type time_type::date_type static_local_time_adjustor< time_type, dst_rule, utc_adjustment< time_duration_type, utc_offset > > time_typeconst time_type &Convert a utc time to local time. time_typeconst time_type &date_time::dst_flagsdate_time::calculateConvert a local time to utc. dst_rulesutc_offset_rulesEmbed the rules for local time adjustments at compile time. time_type::time_duration_type time_type::date_type time_duration_typeconst time_type &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.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. time_duration_typeconst time_type &date_time::dst_flagsdate_time::calculateGet the offset to UTC given a local time. Provides a base offset adjustment from utc. time_duration_type time_duration_type void
date_type::day_of_week_type date_type::month_type date_type::year_type date_time::last_kday_of_month< date_type > date_time::last_kday_of_month< date_type > day_of_week_typeyear_type month_typeyear_type day_of_week_typeyear_type month_typeyear_type int int int date_typeyear_type date_typeyear_type Rules for daylight savings start in the EU (Last Sun in Mar) 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) date_type::day_of_week_type date_type::month_type date_type::year_type date_time::last_kday_of_month< date_type > date_time::last_kday_of_month< date_type > day_of_week_typeyear_type month_typeyear_type day_of_week_typeyear_type month_typeyear_type int int int date_typeyear_type date_typeyear_type boost::date_time::eu_dst_trait< date_type >Alternative dst traits for some parts of the United Kingdom. int int int Specification for daylight savings start rules in US. This class is used to configure dst_calc_engine template typically as follows: using namespace boost::gregorian; using namespace boost::posix_time; typedef us_dst_trait<date> us_dst_traits; 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. date_type::day_of_week_type date_type::month_type date_type::year_type date_time::nth_kday_of_month< date_type > date_time::first_kday_of_month< date_type > date_time::first_kday_of_month< date_type > date_time::last_kday_of_month< date_type > day_of_week_typeyear_type month_typeyear_type day_of_week_typeyear_type month_typeyear_type date_typeyear_type date_typeyear_type int int int
This file contains a high resolution time clock implementation. A clock providing microsecond level resolution. 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. time_type::date_type time_type::time_duration_type time_duration_type::rep_type time_typeshared_ptr< time_zone_type >return a local time object for the given zone, based on computer clock time_typeReturns the local time based on computer clock settings. time_typeReturns the UTC time based on computer settings. time_typetime_converter boost::uint64_tboost::winapi::FILETIME_ const &The function converts file_time into number of microseconds elapsed since 1970-Jan-01Only dates after 1970-Jan-01 are supported. Dates before will be wrapped.
Enum for distinguishing parsing and formatting options. Enum for distinguishing the order of Month, Day, & Year. Enum for distinguishing the order in which Month, Day, & Year will appear in a date string
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. boost::less_than_comparable< period< point_rep, duration_rep >, boost::equality_comparable< period< point_rep, duration_rep > > >Provides generalized period type useful in date-time systems. 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 begining point and a duration or the begining point and the end point( end is NOT part of the period but 1 unit past it. A period will be "invalid" if either end_point <= begin_point or the given duration is <= 0. Any valid period will return false for is_null().Zero length periods are also considered invalid. Zero length periods are periods where the begining and end points are the same, or, the given duration is zero. For a zero length period, the last point will be one unit less than the begining point.In the case that the begin and last are the same, the period has a length of one unit.The best way to handle periods is usually to provide a begining 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). point_rep duration_rep point_repReturn the first element in the period. point_repReturn one past the last element. point_repReturn the last item in the period. duration_repReturn the length of the period. boolTrue if period is ill formed (length is zero or less) boolconst period &Equality operator. boolconst period &Strict as defined by rhs.last <= lhs.last. voidconst duration_rep &Shift the start and end by the specified amount. voidconst duration_rep &Expands the size of the period by the duration on both ends.So before expand [-------] ^ ^ ^ ^ ^ ^ ^ 1 2 3 4 5 6 7 After expand(2) [----------------------] ^ ^ ^ ^ ^ ^ ^ 1 2 3 4 5 6 7 boolconst point_rep &True if the point is inside the period, zero length periods contain no points. boolconst period &True if this period fully contains (or equals) the other period. boolconst period &True if the periods overlap in any way. boolconst period &True if periods are next to each other without a gap. boolconst point_rep &True if all of the period is prior to the passed point or end <= t. boolconst point_rep &True if all of the period is prior or t < start. periodconst period &Returns the period of intersection or invalid range no intersection. periodconst period &Returns the union of intersecting periods – or null period. periodconst period &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----------) point_reppoint_repcreate a period from begin to last eg: [begin,end) If end <= begin then the period will be invalid point_repduration_repcreate a period as [begin, begin+len) If len is <= 0 then the period will be invalid
Not a facet, but a class used to specify and control period formats. Provides settings for the following: period_separator – default '/' period_open_start_delimeter – default '[' period_open_range_end_delimeter – default ')' period_closed_range_end_delimeter – default ']' display_as_open_range, display_as_closed_range – default closed_range Thus the default formatting for a period is as follows: [period.start()/period.last()] So for a typical date_period this would be [2004-Jan-04/2004-Feb-01] where the date formatting is controlled by the date facet std::basic_string< CharT > CharT std::basic_string< char_type >::const_iterator std::vector< std::basic_string< CharT > > const char_type const char_type const char_type const char_type OutItrTOutItrT &Puts the characters between period elements into stream – default is /. OutItrTOutItrT &Puts the period start characters into stream – default is [. OutItrTOutItrT &Puts the period end characters into stream as controled by open/closed range setting. range_display_options voidrange_display_optionsReset the range_option control. voidconst string_type &const string_type &const string_type &const string_type &Change the delimiter strings. OutItrTOutItrTstd::ios_base &char_typeconst period_type &const facet_type &Generic code to output a period – no matter the period type. This generic code will output any period using a facet to to output the 'elements'. For example, in the case of a date_period the elements will be instances of a date which will be formatted according the to setup in the passed facet parameter.The steps for formatting a period are always the same: put the start delimiter put start element put the separator put either last or end element depending on range settings put end delimeter depending on range settings Thus for a typical date period the result might look like this: [March 01, 2004/June 07, 2004] <-- closed range [March 01, 2004/June 08, 2004) <-- open range range_display_optionsAS_CLOSED_RANGEconst char_type *constdefault_period_separatorconst char_type *constdefault_period_start_delimeterconst char_type *constdefault_period_open_range_end_delimeterconst char_type *constdefault_period_closed_range_end_delimeterConstructor that sets up period formatter options – default should suffice most cases.
Not a facet, but a class used to specify and control period parsing. Provides settings for the following: period_separator – default '/' period_open_start_delimeter – default '[' period_open_range_end_delimeter – default ')' period_closed_range_end_delimeter – default ']' display_as_open_range, display_as_closed_range – default closed_range For a typical date_period, the contents of the input stream would be [2004-Jan-04/2004-Feb-01] where the date format is controlled by the date facet std::basic_string< CharT > CharT std::istreambuf_iterator< CharT > string_parse_tree< CharT > parse_tree_type::parse_match_result_type std::vector< std::basic_string< CharT > > const char_type const char_type const char_type const char_type period_range_option voidperiod_range_option collection_type voidconst string_type &const string_type &const string_type &const string_type & period_typestream_itr_type &stream_itr_type &std::ios_base &const period_type &const duration_type &const facet_type &Generic code to parse a period – no matter the period type. This generic code will parse any period using a facet to to get the 'elements'. For example, in the case of a date_period the elements will be instances of a date which will be parsed according the to setup in the passed facet parameter.The steps for parsing a period are always the same: consume the start delimiter get start element consume the separator get either last or end element depending on range settings consume the end delimeter depending on range settings Thus for a typical date period the contents of the input stream might look like this: [March 01, 2004/June 07, 2004] <-- closed range [March 01, 2004/June 08, 2004) <-- open range period_range_optionAS_CLOSED_RANGEconst char_type *constdefault_period_separatorconst char_type *constdefault_period_start_delimeterconst char_type *constdefault_period_open_range_end_delimeterconst char_type *constdefault_period_closed_range_end_delimeterConstructor that sets up period parser options. const period_parser< date_type, CharT > & voidstream_itr_type &stream_itr_type &const string_type &throws ios_base::failure if delimiter and parsed data do not match
Class that provides generic formmatting ostream formatting for special values. This class provides for the formmating of special values to an output stream. In particular, it produces strings for the values of negative and positive infinity as well as not_a_date_time.While not a facet, this class is used by the date and time facets for formatting special value types. std::basic_string< CharT > CharT std::vector< string_type > const char_typeStorage for the strings used to indicate special values. OutItrTOutItrTconst boost::date_time::special_values & Construct special values formatter using default strings. Default strings are not-a-date-time -infinity +infinity const char_type *const *const char_type *const *Construct special values formatter from array of strings. This constructor will take pair of iterators from an array of strings that represent the special values and copy them for use in formatting special values. const char* const special_value_names[]={"nadt","-inf","+inf" }; special_value_formatter svf(&special_value_names[0], &special_value_names[3]); typename collection_type::iteratortypename collection_type::iterator
Class for special_value parsing. TODO: add doc-comments for which elements can be changed Parses input stream for strings representing special_values. Special values parsed are: not_a_date_time neg_infin pod_infin min_date_time max_date_time std::basic_string< charT > std::basic_stringstream< charT > std::istreambuf_iterator< charT > date_type::duration_type string_parse_tree< charT > parse_tree_type::parse_match_result_type std::vector< std::basic_string< charT > > charT const char_type const char_type const char_type const char_type const char_type voidconst string_type &const string_type &const string_type &const string_type &const string_type &Replace special value strings. boolstream_itr_type &the start iterator stream_itr_type &the end iterator match_results &the match result: mr.current_match is set to the corresponding special_value or -1 Given an input iterator, attempt to match it to a known special value whether something matched Creates a special_values_parser with the default set of "sv_strings". const string_type &const string_type &const string_type &const string_type &const string_type &Creates a special_values_parser using a user defined set of element strings. typename collection_type::iteratortypename collection_type::iterator const special_values_parser< date_type, charT > & boolconst string_type &the string to check The parser is expensive to create, and not thread-safe so it cannot be static therefore given a string, determine if it is likely to be a special value. A negative response is a definite no, whereas a positive is only likely and match() should be called and return value checked. false if it is definitely not a special value
std::basic_string< OutputT >const std::basic_string< InputT > &Converts a string from one value_type to another. Converts a wstring to a string (or a string to wstring). If both template parameters are of same type, a copy of the input string is returned.
= -1 std::basic_string< charT > string_type unsigned short short string_type charT boolReturns true if more characters were parsed than was necessary. Should be used in conjunction with last_char() to get the remaining character. Recursive data structure to allow efficient parsing of various strings. This class provides a quick lookup by building what amounts to a tree data structure. It also features a match function which can can handle nasty input interators by caching values as it recurses the tree so that it can backtrack as needed. std::multimap< charT, string_parse_tree< charT > > std::multimap< charT, string_parse_tree > ptree_coll::value_type ptree_coll::iterator ptree_coll::const_iterator std::basic_string< charT > std::vector< std::basic_string< charT > > parse_match_result< charT > ptree_coll short voidconst string_type &unsigned short shortstd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &parse_match_result_type &unsigned int &Recursive function that finds a matching string in the tree. Must check match_results::has_remaining() after match() is called. This is required so the user can determine if stream iterator is already pointing to the expected character or not (match() might advance sitr to next char in stream).A parse_match_result that has been returned from a failed match attempt can be sent in to the match function of a different string_parse_tree to attempt a match there. Use the iterators for the partially consumed stream, the parse_match_result object, and '0' for the level parameter. parse_match_result_typestd::istreambuf_iterator< charT > &std::istreambuf_iterator< charT > &Must check match_results::has_remaining() after match() is called. This is required so the user can determine if stream iterator is already pointing to the expected character or not (match() might advance sitr to next char in stream). voidstd::ostream &int & voidstd::ostream & voidstd::ostream &charT collection_typeunsigned int0Parameter "starting_point" designates where the numbering begins. A starting_point of zero will start the numbering at zero (Sun=0, Mon=1, ...) were a starting_point of one starts the numbering at one (Jan=1, Feb=2, ...). The default is zero, negative vaules are not allowed shortparse_match_result_type::PARSE_ERROR std::basic_ostream< charT > &std::basic_ostream< charT > &parse_match_result< charT > &
std::vector< std::basic_string< charT > >const std::locale &The locale to use when gathering the strings booltrueTrue(default) to gather short strings, false for long strings. This function gathers up all the month strings from a std::locale. Using the time_put facet, this function creates a collection of all the month strings from a locale. This is handy when building custom date parsers or formatters that need to be localized. A vector of strings containing the strings in order. eg: Jan, Feb, Mar, etc. std::vector< std::basic_string< charT > >const std::locale &The locale to use when gathering the strings booltrueTrue(default) to gather short strings, false for long strings. This function gathers up all the weekday strings from a std::locale. Using the time_put facet, this function creates a collection of all the weekday strings from a locale starting with the string for 'Sunday'. This is handy when building custom date parsers or formatters that need to be localized. A vector of strings containing the weekdays in order. eg: Sun, Mon, Tue, Wed, Thu, Fri, Sat
This file contains the interface for the time associated classes. boost::less_than_comparable< T, boost::equality_comparable< T > >Representation of a precise moment in time, including the date. 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. void T time_system::time_rep_type time_system::date_type time_system::date_duration_type time_system::time_duration_type date_type time_duration_type std::stringboolfalseOptional bool parameter will return time zone as an offset (ie "+07:00"). Empty string is returned for classes that do not use a time_zone std::stringboolfalseOptional bool parameter will return time zone as an offset (ie "+07:00"). Empty string is returned for classes that do not use a time_zone std::stringAn empty string is returned for classes that do not use a time_zone. boolcheck to see if date is not a value boolcheck to see if date is one of the infinity values boolcheck to see if date is greater than all possible dates boolcheck to see if date is greater than all possible dates boolcheck to see if time is a special value boolconst time_type &Equality operator – others generated by boost::equality_comparable. boolconst time_type &Equality operator – others generated by boost::less_than_comparable. time_duration_typeconst time_type &difference between two times time_typeconst date_duration_type &add date durations time_typeconst date_duration_type & time_typeconst date_duration_type &subtract date durations time_typeconst date_duration_type & time_typeconst time_duration_type &add time durations time_typeconst time_duration_type & time_typeconst time_duration_type &subtract time durations time_typeconst time_duration_type & const date_type &const time_duration_type &dst_flagsnot_dst special_values const time_rep_type &
This file contains the interface for clock devices. A clock providing time level services based on C time_t capabilities. This clock provides resolution to the 1 second level time_type::date_type time_type::time_duration_type time_type time_typeGet the current day in universal date as a ymd_type. time_typeboost::shared_ptr< time_zone_type > time_type::std::tm *
This file contains nice definitions for handling the resoluion of various time reprsentations. = hundrethDefines some nice types for handling time level resolutions. Flags for daylight savings or summer time.
base_durationTemplate for instantiating derived adjusting durations. base_duration::impl_type base_duration::traits_type (traits_type::ticks_per_second >=frac_of_second ? traits_type::ticks_per_second % frac_of_second :frac_of_second % traits_type::ticks_per_second)=0\ "The base duration resolution must be a multiple of the subsecond duration resolution" boost::int64_tadjustment_ratio(traits_type::ticks_per_second >=frac_of_second ? traits_type::ticks_per_second/frac_of_second :frac_of_second/traits_type::ticks_per_second) T const &typename boost::enable_if< boost::is_integral< T >, void >::type *BOOST_DATE_TIME_NULLPTR boost::less_than_comparable< T, boost::equality_comparable< T > >Represents some amount of elapsed time measure to a given resolution. 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. void T rep_type rep_type::day_type rep_type::hour_type rep_type::min_type rep_type::sec_type rep_type::fractional_seconds_type rep_type::tick_type rep_type::impl_type hour_typeReturns number of hours in the duration. min_typeReturns normalized number of minutes. sec_typeReturns normalized number of seconds (0..60) sec_typeReturns total number of seconds truncating any fractional seconds. tick_typeReturns total number of milliseconds truncating any fractional seconds. tick_typeReturns total number of nanoseconds truncating any sub millisecond values. tick_typeReturns total number of microseconds truncating any sub microsecond values. fractional_seconds_typeReturns count of fractional seconds at given resolution. duration_type duration_type bool bool bool boolconst time_duration & boolconst time_duration & duration_typeunary- Allows for time_duration td = -td1 duration_typeconst duration_type & duration_typeconst duration_type & duration_typeint duration_typeconst duration_type & duration_typeconst duration_type & duration_typeintDivision operations on a duration with an integer. duration_typeintMultiplication operations an a duration with an integer. duration_typeint tick_type boolIs ticks_ a special value? boolIs duration pos-infinity. boolIs duration neg-infinity. boolIs duration not-a-date-time. impl_typeUsed for special_values output. hour_typemin_typesec_type0fractional_seconds_type0 const time_duration< T, rep_type > &Construct from another time_duration (Copy constructor) special_valuesConstruct from special_values. duration_typeReturns smallest representable duration. tick_typeReturn the number of ticks in a second. time_resolutionsProvide the resolution of this duration type. unsigned shortReturns number of possible digits in fractional seconds. impl_type
boost::date_time::date_facet< time_type::date_type, CharT, OutItrT >Facet used for format-based output of time types This class provides for the use of format strings to output times. In addition to the flags for formatting date elements, the following are the allowed format flags: x X => default format - enables addition of more flags to default (ie. "%x %X %z") f => fractional seconds ".123456" F => fractional seconds or none: like frac sec but empty if frac sec == 0 s => seconds w/ fractional sec "02.123" (this is the same as "%S%f) - %S => seconds "02" - %z => abbreviated time zone "EDT" - %Z => full time zone name "Eastern Daylight Time" time_type::date_type time_type::time_duration_type boost::date_time::period< time_type, time_duration_type > boost::date_time::date_facet< typename time_type::date_type, CharT, OutItrT > base_type::string_type base_type::char_type base_type::period_formatter_type base_type::special_values_formatter_type base_type::date_gen_formatter_type const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * std::locale::id std::locale::id &void voidconst char_type *constChanges format for time_duration. void void OutItrTOutItrTstd::ios_base &char_typeconst time_type & OutItrTOutItrTstd::ios_base &char_typeconst time_duration_type &put function for time_duration OutItrTOutItrTstd::ios_base &char_typeconst period_type & ::size_t0sets default formats for ptime, local_date_time, and time_duration const char_type *period_formatter_typeperiod_formatter_type()const special_values_formatter_type &special_values_formatter_type()date_gen_formatter_typedate_gen_formatter_type()::size_t0Construct the facet with an explicitly specified format. string_typeconst time_duration_type &bool string_typeconst time_duration_type &int2 string_typeIntTint2 CharT const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type const char_type boost::date_time::date_input_facet< time_type::date_type, CharT, InItrT >Facet for format-based input. time_type::date_type time_type::time_duration_type time_duration_type::fractional_seconds_type boost::date_time::period< time_type, time_duration_type > boost::date_time::date_input_facet< typename time_type::date_type, CharT, InItrT > base_type::duration_type base_type::year_type base_type::month_type base_type::day_type base_type::string_type string_type::const_iterator base_type::char_type base_type::format_date_parser_type base_type::period_parser_type base_type::special_values_parser_type base_type::date_gen_parser_type base_type::special_values_parser_type::match_results const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * const char_type * std::locale::id voidconst char_type *constSet the format for time_duration. void void InItrTInItrT &InItrT &std::ios_base &period_type & InItrTInItrT &InItrT &std::ios_base &time_duration_type & InItrTInItrT &InItrT &std::ios_base &time_type &Parses a time object from the input stream. InItrTInItrT &InItrT &std::ios_base &time_type &string_type &Expects a time_zone in the input stream. const string_type &::size_t0Constructor that takes a format string for a ptime. const string_type &const format_date_parser_type &const special_values_parser_type &const period_parser_type &const date_gen_parser_type &::size_t0 ::size_t0sets default formats for ptime, local_date_time, and time_duration InItrTInItrT &InItrT &std::ios_base &time_type &string_type &bool InItrTInItrT &InItrT &temporal_type &char_type'\0'Helper function to check for special_value. First character may have been consumed during original parse attempt. Parameter 'c' should be a copy of that character. Throws ios_base::failure if parse fails. voidInItrT &InItrT &fracional_seconds_type &Helper function for parsing a fractional second type from the stream. int_typeint_typeconst unsigned shortHelper function to adjust trailing zeros when parsing fractional digits.
Put a time type into a stream using appropriate facets. std::basic_ostream< charT > time_duration_type::fractional_seconds_type voidconst time_duration_type &ostream_type &Put time into an ostream. Put a time type into a stream using appropriate facets. std::basic_ostream< charT > time_type::date_type time_type::time_duration_type ostream_time_duration_formatter< time_duration_type, charT > voidconst time_type &ostream_type &Put time into an ostream. Put a time period into a stream using appropriate facets. std::basic_ostream< charT > time_period_type::point_type ostream_time_formatter< time_type, charT > voidconst time_period_type &ostream_type &Put time into an ostream.
Simple time iterator skeleton class. time_type::time_duration_type time_itr & time_itr & time_type time_type * boolconst time_type & boolconst time_type & boolconst time_type & boolconst time_type & boolconst time_type & boolconst time_type & time_typetime_duration_type
int_typeint_typeint_typecomputes exponential math like 2^8 => 256, only works with positive integers time_durationconst std::basic_string< char_type > &Creates a time_duration object from a delimited string. Expected format for string is "[-]h[h][:mm][:ss][.fff]". If the number of fractional digits provided is greater than the precision of the time duration type then the extra digits are truncated.A negative duration will be created if the first character in string is a '-', all other '-' will be treated as delimiters. Accepted delimiters are "-:,.". time_durationconst std::string &Creates a time_duration object from a delimited string. Expected format for string is "[-]h[h][:mm][:ss][.fff]". If the number of fractional digits provided is greater than the precision of the time duration type then the extra digits are truncated.A negative duration will be created if the first character in string is a '-', all other '-' will be treated as delimiters. Accepted delimiters are "-:,.". boolconst std::string &charstd::string &std::string &Utility function to split appart string. time_typeconst std::string &char time_durationconst std::string &Parse time duration part of an iso time of form: [-]hhmmss.fff... time_typeconst std::string &charParse time string of form YYYYMMDDThhmmss where T is delimeter between date and time.
frac_sec_type::int_type frac_sec_type::int_type frac_sec_type::impl_type var_type var_type var_type var_type fractional_seconds_typeimpl_type bool time_resolutions unsigned short fractional_seconds_type tick_typehour_typemin_typesec_typefractional_seconds_typeAny negative argument results in a negative tick_count. boost::int64_tticks_per_secondresolution_adjust fractional_seconds_typeticks_per_secondresolution_adjust traits struct for time_resolution_traits implementation type boost::int32_t boost::date_time::int_adapter< boost::int32_t > int_typeimpl_type boolUsed to determine if implemented type is int_adapter or int. traits struct for time_resolution_traits implementation type boost::int64_t boost::date_time::int_adapter< boost::int64_t > int_typeimpl_type boolUsed to determine if implemented type is int_adapter or int. traits struct for time_resolution_traits implementation type boost::int32_t boost::int32_t int_typeimpl_type boolUsed to determine if implemented type is int_adapter or int. traits struct for time_resolution_traits implementation type boost::int64_t boost::int64_t int_typeimpl_type boolUsed to determine if implemented type is int_adapter or int. time_resolution_traits< time_resolution_traits_adapted32_impl, milli, 1000, 3 > time_resolution_traits< time_resolution_traits_adapted64_impl, micro, 1000000, 6 > time_resolution_traits< time_resolution_traits_adapted64_impl, nano, 1000000000, 9 > TTSimple function to calculate absolute value of a numeric type.
Time representation that uses a single integer count. config::int_type config::date_type config::impl_type date_type::duration_type date_type::calendar_type date_type::ymd_type config::time_duration_type config::resolution_traits date_type unsigned long int_type int_type bool bool bool bool impl_type const date_type &const time_duration_type & int_type impl_type int_type An unadjusted time system implementation. time_rep time_rep_type::impl_type time_rep_type::time_duration_type time_duration_type::fractional_seconds_type time_rep_type::date_type time_rep_type::date_duration_type voidconst T & time_rep_typeconst date_type &const time_duration_type &date_time::dst_flagsnot_dst time_rep_typespecial_values date_typeconst time_rep_type & time_duration_typeconst time_rep_type & std::stringconst time_rep_type & boolconst time_rep_type &const time_rep_type & boolconst time_rep_type &const time_rep_type & time_rep_typeconst time_rep_type &const date_duration_type & time_rep_typeconst time_rep_type &const date_duration_type & time_rep_typeconst time_rep_type &const time_duration_type & time_rep_typeconst time_rep_type &time_duration_type time_duration_typeconst time_rep_type &const time_rep_type &
An unadjusted time system implementation. config::time_rep_type config::date_type config::time_duration_type config::date_duration_type config::int_type config::resolution_traits date_time::wrapping_int< int_type, INT64_C(86400) *ticks_per_second > date_time::wrapping_int< split_timedate_system::int_type, split_timedate_system::ticks_per_day > date_time::wrapping_int< int_type, ticks_per_day > int_typeticks_per_dayINT64_C(86400) *config::tick_per_second time_rep_typespecial_values time_rep_typeconst date_type &const time_duration_type &date_time::dst_flagsnot_dst date_typeconst time_rep_type & time_duration_typeconst time_rep_type & std::stringconst time_rep_type & boolconst time_rep_type &const time_rep_type & boolconst time_rep_type &const time_rep_type & time_rep_typeconst time_rep_type &const date_duration_type & time_rep_typeconst time_rep_type &const date_duration_type & time_rep_typeconst time_rep_type &const time_duration_type & time_rep_typeconst time_rep_type &time_duration_type time_duration_typeconst time_rep_type &const time_rep_type &
Structure which holds the time offsets associated with daylight savings time. time_duration_typeAmount DST adjusts the clock eg: plus one hour. time_duration_typeTime past midnight on start transition day that dst starts. time_duration_typeTime past midnight on end transition day that dst ends. const time_duration_type &const time_duration_type &const time_duration_type & Interface class for dynamic time zones. This class represents the base interface for all timezone representations. Subclasses may provide different systems for identifying a particular zone. For example some may provide a geographical based zone construction while others may specify the offset from GMT. Another possible implementation would be to convert from POSIX timezone strings. Regardless of the construction technique, this is the interface that these time zone types must provide.Note that this class is intended to be used as a shared resource (hence the derivation from boost::counted_base. CharT std::basic_string< CharT > std::basic_ostringstream< CharT > time_type::date_type::year_type time_type::time_duration_type string_typeString for the timezone when in daylight savings (eg: EDT) string_typeString for the zone when not in daylight savings (eg: EST) string_typeString for the timezone when in daylight savings (eg: Eastern Daylight Time) string_typeString for the zone when not in daylight savings (eg: Eastern Standard Time) boolTrue if zone uses daylight savings adjustments otherwise false. time_typeyear_typeLocal time that DST starts – undefined if has_dst is false. time_typeyear_typeLocal time that DST ends – undefined if has_dst is false. time_duration_typeBase offset from UTC for zone (eg: -07:30:00) time_duration_typeAdjustment forward or back made while DST is in effect. string_typeReturns a POSIX time_zone string for this object.
CharT const char_type const char_type const char_type Base type that holds various string names for timezone output. Class that holds various types of strings used for timezones. For example, for the western United States there is the full name: Pacific Standard Time and the abbreviated name: PST. During daylight savings there are additional names: Pacific Daylight Time and PDT. std::basic_string< CharT > string_type string_type string_type string_type const string_type &const string_type &const string_type &const string_type &
out_of_rangeException thrown when tz database locates incorrect field structure in data file. const std::string & logic_errorException thrown when tz database cannot locate requested data file. const std::string & Creates a database of time_zones from csv datafile. The csv file containing the zone_specs used by the tz_db_base is intended to be customized by the library user. When customizing this file (or creating your own) the file must follow a specific format.This first line is expected to contain column headings and is therefore not processed by the tz_db_base.Each record (line) must have eleven fields. Some of those fields can be empty. Every field (even empty ones) must be enclosed in double-quotes. Ex: "America/Phoenix" <- string enclosed in quotes "" <- empty field Some fields represent a length of time. The format of these fields must be: "{+|-}hh:mm[:ss]" <- length-of-time format Where the plus or minus is mandatory and the seconds are optional.Since some time zones do not use daylight savings it is not always necessary for every field in a zone_spec to contain a value. All zone_specs must have at least ID and GMT offset. Zones that use daylight savings must have all fields filled except: STD ABBR, STD NAME, DST NAME. You should take note that DST ABBR is mandatory for zones that use daylight savings (see field descriptions for further details).******* Fields and their description/details *********ID: Contains the identifying string for the zone_spec. Any string will do as long as it's unique. No two ID's can be the same.STD ABBR: STD NAME: DST ABBR: DST NAME: These four are all the names and abbreviations used by the time zone being described. While any string will do in these fields, care should be taken. These fields hold the strings that will be used in the output of many of the local_time classes. Ex: time_zone nyc = tz_db.time_zone_from_region("America/New_York"); local_time ny_time(date(2004, Aug, 30), IS_DST, nyc); cout << ny_time.to_long_string() << endl; // 2004-Aug-30 00:00:00 Eastern Daylight Time cout << ny_time.to_short_string() << endl; // 2004-Aug-30 00:00:00 EDT NOTE: The exact format/function names may vary - see local_time documentation for further details.GMT offset: This is the number of hours added to utc to get the local time before any daylight savings adjustments are made. Some examples are: America/New_York offset -5 hours, & Africa/Cairo offset +2 hours. The format must follow the length-of-time format described above.DST adjustment: The amount of time added to gmt_offset when daylight savings is in effect. The format must follow the length-of-time format described above.DST Start Date rule: This is a specially formatted string that describes the day of year in which the transition take place. It holds three fields of it's own, separated by semicolons. The first field indicates the "nth" weekday of the month. The possible values are: 1 (first), 2 (second), 3 (third), 4 (fourth), 5 (fifth), and -1 (last). The second field indicates the day-of-week from 0-6 (Sun=0). The third field indicates the month from 1-12 (Jan=1).Examples are: "-1;5;9"="Last Friday of September", "2;1;3"="Second Monday of March"Start time: Start time is the number of hours past midnight, on the day of the start transition, the transition takes place. More simply put, the time of day the transition is made (in 24 hours format). The format must follow the length-of-time format described above with the exception that it must always be positive.DST End date rule: See DST Start date rule. The difference here is this is the day daylight savings ends (transition to STD).End time: Same as Start time. char time_zone_type::base_type time_zone_type::time_duration_type time_zone_names_base< char_type > boost::date_time::dst_adjustment_offsets< time_duration_type > std::basic_string< char_type > voidstd::istream &Process csv data file, may throw exceptions. May throw bad_field_count exceptions voidconst std::string &Process csv data file, may throw exceptions. May throw data_not_accessible, or bad_field_count exceptions boolconst string_type &boost::shared_ptr< time_zone_base_type >returns true if record successfully added to map Takes a region name in the form of "America/Phoenix", and a time_zone object for that region. The id string must be a unique name that does not already exist in the database. boost::shared_ptr< time_zone_base_type >const string_type &Returns a time_zone object built from the specs for the given region. Returns a time_zone object built from the specs for the given region. If region does not exist a local_time::record_not_found exception will be thrown std::vector< std::string >Returns a vector of strings holding the time zone regions in the database. Constructs an empty database. rule_type *const string_type &const string_type &parses rule specs for transition day rules week_numinthelper function for parse_rules() voidint &int &int &string_typesplits the [start|end]_date_rule string into 3 ints boolstring_type &Take a line from the csv, turn it into a time_zone_type. Take a line from the csv, turn it into a time_zone_type, and add it to the map. Zone_specs in csv file are expected to have eleven fields that describe the time zone. Returns true if zone_spec successfully added to database
A wrapping integer used to support time durations (WARNING: only instantiate with a signed type) In composite date and time types this type is used to wrap at the day boundary. Ex: A wrapping_int<short, 10> will roll over after nine, and roll under below zero. This gives a range of [0,9]NOTE: it is strongly recommended that wrapping_int2 be used instead of wrapping_int as wrapping_int is to be depricated at some point soon.Also Note that warnings will occur if instantiated with an unsigned type. Only a signed type should be used! int_type_ int_type int_typeExplicit converion method. int_type IntTIntTAdd, return number of wraps performed. The sign of the returned value will indicate which direction the wraps went. Ex: add a negative number and wrapping under could occur, this would be indicated by a negative return value. If wrapping over took place, a positive value would be returned IntTIntTSubtract will return '+d' if wrapping under took place ('d' is the number of wraps) The sign of the returned value will indicate which direction the wraps went (positive indicates wrap under, negative indicates wrap over). Ex: subtract a negative number and wrapping over could occur, this would be indicated by a negative return value. If wrapping under took place, a positive value would be returned. int_typeAdd, return true if wrapped. IntTIntT A wrapping integer used to wrap around at the top (WARNING: only instantiate with a signed type) Bad name, quick impl to fix a bug – fix later!! This allows the wrap to restart at a value other than 0. int_type_ int_type int_type int_typeExplicit converion method. int_type IntTIntTAdd, return number of wraps performed. The sign of the returned value will indicate which direction the wraps went. Ex: add a negative number and wrapping under could occur, this would be indicated by a negative return value. If wrapping over took place, a positive value would be returned IntTIntTSubtract will return '-d' if wrapping under took place ('d' is the number of wraps) The sign of the returned value will indicate which direction the wraps went. Ex: subtract a negative number and wrapping over could occur, this would be indicated by a positive return value. If wrapping under took place, a negative value would be returned int_typeIf initializing value is out of range of [wrap_min, wrap_max], value will be initialized to closest of min or max IntTIntT
Allow rapid creation of ymd triples of different types. YearType MonthType DayType YearType MonthType DayType YearTypeMonthTypeDayTypeA basic constructor.