Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::date_time Namespace Reference

Classes

struct  acst_dst_trait
 
class  all_date_names_put
 A date name output facet that takes an array of char* to define strings. More...
 
class  bad_field_count
 Exception thrown when tz database locates incorrect field structure in data file. More...
 
class  base_time
 Representation of a precise moment in time, including the date. More...
 
class  c_local_adjustor
 Adjust to / from utc using the C API. More...
 
struct  c_time
 Provides a uniform interface to some 'ctime' functions. More...
 
struct  counted_time_rep
 Time representation that uses a single integer count. More...
 
class  counted_time_system
 An unadjusted time system implementation. More...
 
class  data_not_accessible
 Exception thrown when tz database cannot locate requested data file. More...
 
class  date
 Representation of timepoint at the one day level resolution. More...
 
class  date_duration
 Duration type with date level resolution. More...
 
class  date_facet
 Class that provides format based I/O facet for date types. More...
 
class  date_formatter
 Convert a date to string using format policies. More...
 
class  date_generator_formatter
 Formats date_generators for output. More...
 
class  date_generator_parser
 Class for date_generator parsing. More...
 
class  date_input_facet
 Input facet. More...
 
class  date_itr
 Overrides the base date iterator providing hook for functors. More...
 
class  date_itr_base
 Base date iterator type. More...
 
class  date_names_put
 Output facet base class for gregorian dates. More...
 
class  day_calc_dst_rule
 Canonical form for a class that provides day rule calculation. More...
 
class  day_clock
 A clock providing day level services based on C time_t capabilities. More...
 
class  day_functor
 Functor to iterate a fixed number of days. More...
 
struct  default_zone_names
 
class  dst_adjustment_offsets
 Structure which holds the time offsets associated with daylight savings time. More...
 
class  dst_calc_engine
 Compile-time configurable daylight savings time calculation engine. More...
 
class  dst_calculator
 Dynamic class used to caluclate dst transition information. More...
 
class  dst_day_calc_rule
 Defines base interface for calculating start and end date of daylight savings. More...
 
struct  duration_traits_adapted
 Struct for instantiating date_duration WITH special values functionality. More...
 
struct  duration_traits_long
 Struct for instantiating date_duration with NO special values functionality. More...
 
class  dynamic_local_time_adjustor
 Allow sliding utc adjustment with fixed dst rules. More...
 
struct  eu_dst_trait
 Rules for daylight savings start in the EU (Last Sun in Mar) More...
 
class  first_kday_after
 Calculate something like "First Sunday after Jan 1,2002. More...
 
class  first_kday_before
 Calculate something like "First Sunday before Jan 1,2002. More...
 
class  first_kday_of_month
 Useful generator functor for finding holidays and daylight savings. More...
 
class  format_date_parser
 Class with generic date parsing using a format string. More...
 
class  gregorian_calendar_base
 An implementation of the Gregorian calendar. More...
 
class  int_adapter
 Adapter to create integer types with +-infinity, and not a value. More...
 
class  iso_extended_format
 Extended format uses seperators YYYY-MM-DD. More...
 
class  iso_format
 Format description for iso normal YYYYMMDD. More...
 
class  iso_format_base
 Class to provide common iso formatting spec. More...
 
class  iso_format_base< wchar_t >
 Class to provide common iso formatting spec. More...
 
class  last_kday_of_month
 Calculate something like Last Sunday of January. More...
 
class  local_adjustor
 Template that simplifies the creation of local time calculator. More...
 
class  month_formatter
 Formats a month as as string into an ostream. More...
 
class  month_functor
 Provides calculation to find next nth month given a date. More...
 
class  months_duration
 additional duration type that represents a logical month More...
 
class  nth_kday_of_month
 Useful generator functor for finding holidays. More...
 
class  null_dst_rules
 Used for local time adjustments in places that don't use dst. More...
 
class  ostream_date_formatter
 Convert a date to string using format policies. More...
 
class  ostream_month_formatter
 Formats a month as as string into an ostream. More...
 
class  ostream_time_duration_formatter
 Put a time type into a stream using appropriate facets. More...
 
class  ostream_time_formatter
 Put a time type into a stream using appropriate facets. More...
 
class  ostream_time_period_formatter
 Put a time period into a stream using appropriate facets. More...
 
class  ostream_weekday_formatter
 Formats a weekday. More...
 
class  ostream_ymd_formatter
 Convert ymd to a standard string formatting policies. More...
 
struct  parse_match_result
 
class  partial_date
 Generates a date by applying the year to the given month and day. More...
 
class  period
 Provides generalized period type useful in date-time systems. More...
 
class  period_formatter
 Not a facet, but a class used to specify and control period formats. More...
 
class  period_parser
 Not a facet, but a class used to specify and control period parsing. More...
 
class  second_clock
 A clock providing time level services based on C time_t capabilities. More...
 
class  simple_format
 Class to provide simple basic formatting rules. More...
 
class  simple_format< wchar_t >
 Specialization of formmating rules for wchar_t. More...
 
class  special_values_formatter
 Class that provides generic formmatting ostream formatting for special values. More...
 
class  special_values_parser
 Class for special_value parsing. More...
 
class  split_timedate_system
 An unadjusted time system implementation. More...
 
class  static_local_time_adjustor
 Embed the rules for local time adjustments at compile time. More...
 
struct  string_parse_tree
 Recursive data structure to allow efficient parsing of various strings. More...
 
class  subsecond_duration
 Template for instantiating derived adjusting durations. More...
 
class  time_duration
 Represents some amount of elapsed time measure to a given resolution. More...
 
class  time_facet
 Facet used for format-based output of time types This class provides for the use of format strings to output times. More...
 
struct  time_formats
 
class  time_input_facet
 Facet for format-based input. More...
 
class  time_itr
 Simple time iterator skeleton class. More...
 
class  time_resolution_traits
 
struct  time_resolution_traits_adapted32_impl
 traits struct for time_resolution_traits implementation type More...
 
struct  time_resolution_traits_adapted64_impl
 traits struct for time_resolution_traits implementation type More...
 
struct  time_resolution_traits_bi32_impl
 traits struct for time_resolution_traits implementation type More...
 
struct  time_resolution_traits_bi64_impl
 traits struct for time_resolution_traits implementation type More...
 
class  time_zone_base
 Interface class for dynamic time zones. More...
 
class  time_zone_names_base
 Base type that holds various string names for timezone output. More...
 
class  tz_db_base
 Creates a database of time_zones from csv datafile. More...
 
struct  uk_dst_trait
 Alternative dst traits for some parts of the United Kingdom. More...
 
class  us_dst_rules
 Depricated: Class to calculate dst boundaries for US time zones. More...
 
struct  us_dst_trait
 Specification for daylight savings start rules in US. More...
 
class  utc_adjustment
 Provides a base offset adjustment from utc. More...
 
class  week_functor
 Functor to iterate a over weeks. More...
 
class  weeks_duration
 Additional duration type that represents a number of n*7 days. More...
 
class  wrapping_int
 A wrapping integer used to support time durations (WARNING: only instantiate with a signed type) More...
 
class  wrapping_int2
 A wrapping integer used to wrap around at the top (WARNING: only instantiate with a signed type) More...
 
class  year_based_generator
 Base class for all generators that take a year and produce a date. More...
 
class  year_functor
 Functor to iterate by a year adjusting for leap years. More...
 
struct  year_month_day_base
 Allow rapid creation of ymd triples of different types. More...
 
class  years_duration
 additional duration type that represents a logical year More...
 
class  ymd_formatter
 Convert ymd to a standard string formatting policies. More...
 

Typedefs

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

Enumerations

enum  weekdays {
  Sunday,
  Monday,
  Tuesday,
  Wednesday,
  Thursday,
  Friday,
  Saturday
}
 An enumeration of weekday names. More...
 
enum  months_of_year {
  Jan =1,
  Feb,
  Mar,
  Apr,
  May,
  Jun,
  Jul,
  Aug,
  Sep,
  Oct,
  Nov,
  Dec,
  NotAMonth,
  NumMonths
}
 Simple enum to allow for nice programming with Jan, Feb, etc. More...
 
enum  date_resolutions {
  day,
  week,
  months,
  year,
  decade,
  century,
  NumDateResolutions
}
 An iterator over dates with varying resolution (day, week, month, year, etc) More...
 
enum  time_is_dst_result {
  is_not_in_dst,
  is_in_dst,
  ambiguous,
  invalid_time_label
}
 
enum  month_format_spec {
  month_as_integer,
  month_as_short_string,
  month_as_long_string
}
 Enum for distinguishing parsing and formatting options. More...
 
enum  ymd_order_spec {
  ymd_order_iso,
  ymd_order_dmy,
  ymd_order_us
}
 Enum for distinguishing the order of Month, Day, & Year. More...
 
enum  special_values {
  not_a_date_time,
  neg_infin,
  pos_infin,
  min_date_time,
  max_date_time,
  not_special,
  NumSpecialValues
}
 
enum  time_resolutions {
  sec,
  tenth,
  hundreth,
  hundredth = hundreth,
  milli,
  ten_thousandth,
  micro,
  nano,
  NumResolutions
}
 Defines some nice types for handling time level resolutions. More...
 
enum  dst_flags {
  not_dst,
  is_dst,
  calculate
}
 Flags for daylight savings or summer time. More...
 

Functions

BOOST_DATE_TIME_DECL const char * nth_as_str (int n)
 Returns nth arg as string. 1 -> "first", 2 -> "second", max is 5. More...
 
template<typename date_type , class weekday_type >
date_type::duration_type days_until_weekday (const date_type &d, const weekday_type &wd)
 Calculates the number of days until the next weekday. More...
 
template<typename date_type , class weekday_type >
date_type::duration_type days_before_weekday (const date_type &d, const weekday_type &wd)
 Calculates the number of days since the previous weekday. More...
 
template<class date_type , class weekday_type >
date_type next_weekday (const date_type &d, const weekday_type &wd)
 Generates a date object representing the date of the following weekday from the given date. More...
 
template<class date_type , class weekday_type >
date_type previous_weekday (const date_type &d, const weekday_type &wd)
 Generates a date object representing the date of the previous weekday from the given date. More...
 
std::string convert_to_lower (std::string inp)
 A function to replace the std::transform( , , ,tolower) construct. More...
 
template<class month_type >
unsigned short month_str_to_ushort (std::string const &s)
 Helper function for parse_date. More...
 
template<class charT >
short find_match (const charT *const *short_names, const charT *const *long_names, short size, const std::basic_string< charT > &s)
 Find index of a string in either of 2 arrays. More...
 
template<class date_type >
date_type parse_date (const std::string &s, int order_spec=ymd_order_iso)
 Generic function to parse a delimited date (eg: 2002-02-10) More...
 
template<class date_type >
date_type parse_undelimited_date (const std::string &s)
 Generic function to parse undelimited date (eg: 20020201) More...
 
template<class date_type , class iterator_type >
date_type from_stream_type (iterator_type &beg, iterator_type const &end, char)
 Helper function for 'date gregorian::from_stream()'. More...
 
template<class date_type , class iterator_type >
date_type from_stream_type (iterator_type &beg, iterator_type const &, std::string const &)
 Helper function for 'date gregorian::from_stream()'. More...
 
template<class date_type , class iterator_type >
date_type from_stream_type (iterator_type &beg, iterator_type const &end, wchar_t)
 Helper function for 'date gregorian::from_stream()'. More...
 
template<class date_type , class iterator_type >
date_type from_stream_type (iterator_type &beg, iterator_type const &, std::wstring const &)
 Helper function for 'date gregorian::from_stream()'. More...
 
template<class date_type , class charT >
period< date_type, typename
date_type::duration_type > 
from_simple_string_type (const std::basic_string< charT > &s)
 function called by wrapper functions: date_period_from_(w)string() More...
 
template<typename int_type , typename charT >
int_type fixed_string_to_int (std::istreambuf_iterator< charT > &itr, std::istreambuf_iterator< charT > &stream_end, parse_match_result< charT > &mr, unsigned int length, const charT &fill_char)
 Helper function for parsing fixed length strings into integers. More...
 
template<typename int_type , typename charT >
int_type fixed_string_to_int (std::istreambuf_iterator< charT > &itr, std::istreambuf_iterator< charT > &stream_end, parse_match_result< charT > &mr, unsigned int length)
 Helper function for parsing fixed length strings into integers. More...
 
template<typename int_type , typename charT >
int_type var_string_to_int (std::istreambuf_iterator< charT > &itr, const std::istreambuf_iterator< charT > &stream_end, unsigned int max_length)
 Helper function for parsing varied length strings into integers. More...
 
template<class charT , class traits , typename int_type >
std::basic_ostream< charT,
traits > & 
operator<< (std::basic_ostream< charT, traits > &os, const int_adapter< int_type > &ia)
 Expected output is either a numeric representation or a special values representation. More...
 
void dummy_to_prevent_msvc6_ice ()
 
template<class InputT , class OutputT >
std::basic_string< OutputT > convert_string_type (const std::basic_string< InputT > &inp_str)
 Converts a string from one value_type to another. More...
 
template<typename charT >
std::basic_ostream< charT > & operator<< (std::basic_ostream< charT > &os, parse_match_result< charT > &mr)
 
template<typename charT >
std::vector< std::basic_string
< charT > > 
gather_month_strings (const std::locale &locale, bool short_strings=true)
 This function gathers up all the month strings from a std::locale. More...
 
template<typename charT >
std::vector< std::basic_string
< charT > > 
gather_weekday_strings (const std::locale &locale, bool short_strings=true)
 This function gathers up all the weekday strings from a std::locale. More...
 
template<class int_type >
int_type power (int_type base, int_type exponent)
 computes exponential math like 2^8 => 256, only works with positive integers More...
 
template<class time_duration , class char_type >
time_duration str_from_delimited_time_duration (const std::basic_string< char_type > &s)
 Creates a time_duration object from a delimited string. More...
 
template<class time_duration >
time_duration parse_delimited_time_duration (const std::string &s)
 Creates a time_duration object from a delimited string. More...
 
bool split (const std::string &s, char sep, std::string &first, std::string &second)
 Utility function to split appart string. More...
 
template<class time_type >
time_type parse_delimited_time (const std::string &s, char sep)
 
template<class time_duration >
time_duration parse_undelimited_time_duration (const std::string &s)
 Parse time duration part of an iso time of form: [-]hhmmss.fff... More...
 
template<class time_type >
time_type parse_iso_time (const std::string &s, char sep)
 Parse time string of form YYYYMMDDThhmmss where T is delimeter between date and time. More...
 
template<typename T >
T absolute_value (T x)
 Simple function to calculate absolute value of a numeric type. More...
 

Typedef Documentation

Enumeration Type Documentation

An iterator over dates with varying resolution (day, week, month, year, etc)

Enumerator
day 
week 
months 
year 
decade 
century 
NumDateResolutions 

Flags for daylight savings or summer time.

Enumerator
not_dst 
is_dst 
calculate 

Enum for distinguishing parsing and formatting options.

Enumerator
month_as_integer 
month_as_short_string 
month_as_long_string 

Simple enum to allow for nice programming with Jan, Feb, etc.

Enumerator
Jan 
Feb 
Mar 
Apr 
May 
Jun 
Jul 
Aug 
Sep 
Oct 
Nov 
Dec 
NotAMonth 
NumMonths 
Enumerator
not_a_date_time 
neg_infin 
pos_infin 
min_date_time 
max_date_time 
not_special 
NumSpecialValues 
Enumerator
is_not_in_dst 
is_in_dst 
ambiguous 
invalid_time_label 

Defines some nice types for handling time level resolutions.

Enumerator
sec 
tenth 
hundreth 
hundredth 
milli 
ten_thousandth 
micro 
nano 
NumResolutions 

An enumeration of weekday names.

Enumerator
Sunday 
Monday 
Tuesday 
Wednesday 
Thursday 
Friday 
Saturday 

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

Enumerator
ymd_order_iso 
ymd_order_dmy 
ymd_order_us 

Function Documentation

template<class InputT , class OutputT >
std::basic_string<OutputT> boost::date_time::convert_string_type ( const std::basic_string< InputT > &  inp_str)
inline

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.

std::string boost::date_time::convert_to_lower ( std::string  inp)
inline

A 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.

References boost::multiprecision::backends::i, and boost::n.

Referenced by month_str_to_ushort().

template<typename date_type , class weekday_type >
date_type::duration_type boost::date_time::days_before_weekday ( const date_type &  d,
const weekday_type &  wd 
)
inline

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.

Referenced by previous_weekday().

template<typename date_type , class weekday_type >
date_type::duration_type boost::date_time::days_until_weekday ( const date_type &  d,
const weekday_type &  wd 
)
inline

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

Referenced by next_weekday().

void boost::date_time::dummy_to_prevent_msvc6_ice ( )
template<class charT >
short boost::date_time::find_match ( const charT *const *  short_names,
const charT *const *  long_names,
short  size,
const std::basic_string< charT > &  s 
)

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

References boost::multiprecision::backends::i, and boost::size().

Referenced by boost::gregorian::operator>>().

template<typename int_type , typename charT >
int_type boost::date_time::fixed_string_to_int ( std::istreambuf_iterator< charT > &  itr,
std::istreambuf_iterator< charT > &  stream_end,
parse_match_result< charT > &  mr,
unsigned int  length,
const charT &  fill_char 
)
inline

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.

References boost::date_time::parse_match_result< charT >::cache, boost::multiprecision::backends::i, and boost::lexical_cast().

template<typename int_type , typename charT >
int_type boost::date_time::fixed_string_to_int ( std::istreambuf_iterator< charT > &  itr,
std::istreambuf_iterator< charT > &  stream_end,
parse_match_result< charT > &  mr,
unsigned int  length 
)
inline

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.

References boost::iostreams::bzip2::stream_end.

template<class date_type , class charT >
period<date_type, typename date_type::duration_type> boost::date_time::from_simple_string_type ( const std::basic_string< charT > &  s)

function called by wrapper functions: date_period_from_(w)string()

References boost::tokenizer< TokenizerFunc, Iterator, Type >::begin().

template<class date_type , class iterator_type >
date_type boost::date_time::from_stream_type ( iterator_type &  beg,
iterator_type const &  end,
char   
)
inline

Helper 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

template<class date_type , class iterator_type >
date_type boost::date_time::from_stream_type ( iterator_type &  beg,
iterator_type const &  ,
std::string const &   
)
inline

Helper function for 'date gregorian::from_stream()'.

Returns the first string found in the stream referenced by the begining & end iterators

template<class date_type , class iterator_type >
date_type boost::date_time::from_stream_type ( iterator_type &  beg,
iterator_type const &  end,
wchar_t   
)
inline

Helper 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

References boost::multiprecision::backends::c.

template<class date_type , class iterator_type >
date_type boost::date_time::from_stream_type ( iterator_type &  beg,
iterator_type const &  ,
std::wstring const &   
)
inline

Helper function for 'date gregorian::from_stream()'.

Creates a string from the first wstring found in the stream referenced by the begining & end iterators

References boost::multiprecision::backends::c.

template<typename charT >
std::vector<std::basic_string<charT> > boost::date_time::gather_month_strings ( const std::locale &  locale,
bool  short_strings = true 
)

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.

Parameters
charTThe type of char to use when gathering typically char or wchar_t.
localeThe locale to use when gathering the strings
short_stringsTrue(default) to gather short strings, false for long strings.
Returns
A vector of strings containing the strings in order. eg: Jan, Feb, Mar, etc.

References months, and boost::put().

template<typename charT >
std::vector<std::basic_string<charT> > boost::date_time::gather_weekday_strings ( const std::locale &  locale,
bool  short_strings = true 
)

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.

Parameters
charTThe type of char to use when gathering typically char or wchar_t.
localeThe locale to use when gathering the strings
short_stringsTrue(default) to gather short strings, false for long strings.
Returns
A vector of strings containing the weekdays in order. eg: Sun, Mon, Tue, Wed, Thu, Fri, Sat

References boost::multiprecision::backends::i, and boost::put().

template<class month_type >
unsigned short boost::date_time::month_str_to_ushort ( std::string const &  s)
inline

Helper function for parse_date.

References convert_to_lower(), boost::lexical_cast(), boost::python::ptr(), boost::asio::s, and boost::str().

template<class date_type , class weekday_type >
date_type boost::date_time::next_weekday ( const date_type &  d,
const weekday_type &  wd 
)
inline

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.

References days_until_weekday().

BOOST_DATE_TIME_DECL const char* boost::date_time::nth_as_str ( int  n)

Returns nth arg as string. 1 -> "first", 2 -> "second", max is 5.

Referenced by boost::date_time::nth_kday_of_month< date_type >::nth_week_as_str().

template<typename charT >
std::basic_ostream<charT>& boost::date_time::operator<< ( std::basic_ostream< charT > &  os,
parse_match_result< charT > &  mr 
)
template<class charT , class traits , typename int_type >
std::basic_ostream<charT, traits>& boost::date_time::operator<< ( std::basic_ostream< charT, traits > &  os,
const int_adapter< int_type > &  ia 
)
inline

Expected output is either a numeric representation or a special values representation.


Ex. "12", "+infinity", "not-a-number", etc.

References neg_infin, not_a_date_time, and pos_infin.

template<class date_type >
date_type boost::date_time::parse_date ( const std::string &  s,
int  order_spec = ymd_order_iso 
)

Generic 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

References boost::tokenizer< TokenizerFunc, Iterator, Type >::begin(), day, boost::tokenizer< TokenizerFunc, Iterator, Type >::end(), boost::lexical_cast(), boost::locale::period::marks::month, year, ymd_order_dmy, and ymd_order_iso.

template<class time_type >
time_type boost::date_time::parse_delimited_time ( const std::string &  s,
char  sep 
)
inline

References split().

template<class time_duration >
time_duration boost::date_time::parse_delimited_time_duration ( const std::string &  s)
inline

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 "-:,.".

References boost::asio::s.

template<class time_type >
time_type boost::date_time::parse_iso_time ( const std::string &  s,
char  sep 
)
inline

Parse time string of form YYYYMMDDThhmmss where T is delimeter between date and time.

References split().

template<class date_type >
date_type boost::date_time::parse_undelimited_date ( const std::string &  s)

Generic function to parse undelimited date (eg: 20020201)

References boost::multiprecision::backends::i, boost::lexical_cast(), and boost::polygon::y().

template<class time_duration >
time_duration boost::date_time::parse_undelimited_time_duration ( const std::string &  s)
inline
template<class int_type >
int_type boost::date_time::power ( int_type  base,
int_type  exponent 
)
inline

computes exponential math like 2^8 => 256, only works with positive integers

References boost::multiprecision::backends::i.

Referenced by parse_undelimited_time_duration(), and str_from_delimited_time_duration().

template<class date_type , class weekday_type >
date_type boost::date_time::previous_weekday ( const date_type &  d,
const weekday_type &  wd 
)
inline

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.

References days_before_weekday().

bool boost::date_time::split ( const std::string &  s,
char  sep,
std::string &  first,
std::string &  second 
)
inline

Utility function to split appart string.

Referenced by parse_delimited_time(), and parse_iso_time().

template<class time_duration , class char_type >
time_duration boost::date_time::str_from_delimited_time_duration ( const std::basic_string< char_type > &  s)
inline

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 "-:,.".

References boost::tokenizer< TokenizerFunc, Iterator, Type >::begin(), boost::math::tools::digits(), boost::tokenizer< TokenizerFunc, Iterator, Type >::end(), boost::locale::period::marks::hour, boost::lexical_cast(), boost::accumulators::extract::min, boost::date_time::time_duration< T, rep_type >::num_fractional_digits(), power(), and sec.

template<typename int_type , typename charT >
int_type boost::date_time::var_string_to_int ( std::istreambuf_iterator< charT > &  itr,
const std::istreambuf_iterator< charT > &  stream_end,
unsigned int  max_length 
)
inline

Helper 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 '-'.

References boost::multiprecision::backends::i, boost::lexical_cast(), and boost::asio::s.