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

Defines a non-adjusted time system with nano-second resolution and stable calculation properties. More...

Classes

class  hours
 Allows expression of durations as an hour count. More...
 
class  millisec_posix_time_system_config
 
class  minutes
 Allows expression of durations as a minute count. More...
 
class  ptime
 Time type with no timezone or other adjustments. More...
 
class  seconds
 Allows expression of durations as a seconds count. More...
 
class  time_duration
 Base time duration type. More...
 

Typedefs

typedef
date_time::time_resolution_traits
< boost::date_time::time_resolution_traits_adapted64_impl,
boost::date_time::micro, 1000000, 6 > 
time_res_traits
 
typedef
date_time::subsecond_duration
< time_duration, 1000 > 
millisec
 Allows expression of durations as milli seconds. More...
 
typedef
date_time::subsecond_duration
< time_duration, 1000 > 
milliseconds
 
typedef
date_time::subsecond_duration
< time_duration, 1000000 > 
microsec
 Allows expression of durations as micro seconds. More...
 
typedef
date_time::subsecond_duration
< time_duration, 1000000 > 
microseconds
 
typedef
boost::date_time::time_facet
< ptime, wchar_t > 
wtime_facet
 wptime_facet is depricated and will be phased out. use wtime_facet instead More...
 
typedef
boost::date_time::time_facet
< ptime, char > 
time_facet
 
typedef
boost::date_time::time_input_facet
< ptime, wchar_t > 
wtime_input_facet
 
typedef
boost::date_time::time_input_facet
< ptime, char > 
time_input_facet
 
typedef
date_time::counted_time_rep
< millisec_posix_time_system_config
int64_time_rep
 
typedef
date_time::counted_time_system
< int64_time_rep
posix_time_system
 
typedef date_time::time_itr
< ptime
time_iterator
 Iterator over a defined time duration. More...
 
typedef
date_time::second_clock< ptime
second_clock
 A time clock that has a resolution of one second. More...
 
typedef
date_time::null_dst_rules
< ptime::date_type,
time_duration
no_dst
 Define a dst null dst rule for the posix_time system. More...
 
typedef
date_time::us_dst_rules
< ptime::date_type,
time_duration
us_dst
 Define US dst rule calculator for the posix_time system. More...
 
typedef date_time::period
< ptime, time_duration
time_period
 Time period type. More...
 

Functions

ptime from_time_t (std::time_t t)
 Function that converts a time_t into a ptime. More...
 
std::tm to_tm (const boost::posix_time::ptime &t)
 Convert a time to a tm structure truncating any fractional seconds. More...
 
std::tm to_tm (const boost::posix_time::time_duration &td)
 Convert a time_duration to a tm structure truncating any fractional seconds and zeroing fields for date components. More...
 
ptime ptime_from_tm (const std::tm &timetm)
 Convert a tm struct to a ptime ignoring is_dst flag. More...
 
ptime operator+ (const ptime &t, const boost::gregorian::months &m)
 Adds a months object and a ptime. More...
 
ptime operator+= (ptime &t, const boost::gregorian::months &m)
 Adds a months object to a ptime. More...
 
ptime operator- (const ptime &t, const boost::gregorian::months &m)
 Subtracts a months object and a ptime. More...
 
ptime operator-= (ptime &t, const boost::gregorian::months &m)
 Subtracts a months object from a ptime. More...
 
ptime operator+ (const ptime &t, const boost::gregorian::years &y)
 Adds a years object and a ptime. More...
 
ptime operator+= (ptime &t, const boost::gregorian::years &y)
 Adds a years object to a ptime. More...
 
ptime operator- (const ptime &t, const boost::gregorian::years &y)
 Subtracts a years object and a ptime. More...
 
ptime operator-= (ptime &t, const boost::gregorian::years &y)
 Subtracts a years object from a ptime. More...
 
template<class CharT , class TraitsT >
std::basic_ostream< CharT,
TraitsT > & 
operator<< (std::basic_ostream< CharT, TraitsT > &os, const ptime &p)
 
template<class CharT , class Traits >
std::basic_istream< CharT,
Traits > & 
operator>> (std::basic_istream< CharT, Traits > &is, ptime &pt)
 input operator for ptime More...
 
template<class CharT , class TraitsT >
std::basic_ostream< CharT,
TraitsT > & 
operator<< (std::basic_ostream< CharT, TraitsT > &os, const boost::posix_time::time_period &p)
 
template<class CharT , class Traits >
std::basic_istream< CharT,
Traits > & 
operator>> (std::basic_istream< CharT, Traits > &is, time_period &tp)
 input operator for time_period More...
 
template<class CharT , class Traits >
std::basic_ostream< CharT,
Traits > & 
operator<< (std::basic_ostream< CharT, Traits > &os, const time_duration &td)
 ostream operator for posix_time::time_duration More...
 
template<class CharT , class Traits >
std::basic_istream< CharT,
Traits > & 
operator>> (std::basic_istream< CharT, Traits > &is, time_duration &td)
 input operator for time_duration More...
 
template<class charT >
std::basic_istream< charT > & operator>> (std::basic_istream< charT > &is, time_duration &td)
 
template<class charT >
std::basic_istream< charT > & operator>> (std::basic_istream< charT > &is, ptime &pt)
 
template<class charT >
std::basic_istream< charT > & operator>> (std::basic_istream< charT > &is, time_period &tp)
 operator>> for time_period. More...
 
template<class charT >
std::basic_string< charT > to_simple_string_type (time_duration td)
 
std::string to_simple_string (time_duration td)
 Time duration to string -hh::mm::ss.fffffff. Example: 10:09:03.0123456. More...
 
template<class charT >
std::basic_string< charT > to_iso_string_type (time_duration td)
 
std::string to_iso_string (time_duration td)
 Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456. More...
 
template<class charT >
std::basic_string< charT > to_simple_string_type (ptime t)
 Time to simple format CCYY-mmm-dd hh:mm:ss.fffffff. More...
 
std::string to_simple_string (ptime t)
 Time to simple format CCYY-mmm-dd hh:mm:ss.fffffff. More...
 
template<class charT >
std::basic_string< charT > to_simple_string_type (time_period tp)
 
std::string to_simple_string (time_period tp)
 Convert to string of form [YYYY-mmm-DD HH:MM::SS.ffffff/YYYY-mmm-DD HH:MM::SS.fffffff]. More...
 
template<class charT >
std::basic_string< charT > to_iso_string_type (ptime t)
 
std::string to_iso_string (ptime t)
 Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator. More...
 
template<class charT >
std::basic_string< charT > to_iso_extended_string_type (ptime t)
 
std::string to_iso_extended_string (ptime t)
 Convert to form YYYY-MM-DDTHH:MM:SS where T is the date-time separator. More...
 
std::wstring to_simple_wstring (time_duration td)
 Time duration to wstring -hh::mm::ss.fffffff. Example: 10:09:03.0123456. More...
 
std::wstring to_iso_wstring (time_duration td)
 Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456. More...
 
std::wstring to_simple_wstring (ptime t)
 
std::wstring to_simple_wstring (time_period tp)
 Convert to wstring of form [YYYY-mmm-DD HH:MM::SS.ffffff/YYYY-mmm-DD HH:MM::SS.fffffff]. More...
 
std::wstring to_iso_wstring (ptime t)
 Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator. More...
 
std::wstring to_iso_extended_wstring (ptime t)
 Convert to form YYYY-MM-DDTHH:MM:SS where T is the date-time separator. More...
 
time_duration duration_from_string (const std::string &s)
 Creates a time_duration object from a delimited string. More...
 
ptime time_from_string (const std::string &s)
 
ptime from_iso_string (const std::string &s)
 

Detailed Description

Defines a non-adjusted time system with nano-second resolution and stable calculation properties.

Typedef Documentation

Allows expression of durations as micro seconds.

Allows expression of durations as milli seconds.

A time clock that has a resolution of one second.

Iterator over a defined time duration.

Define US dst rule calculator for the posix_time system.

wptime_facet is depricated and will be phased out. use wtime_facet instead

ptime_facet is depricated and will be phased out. use time_facet instead wptime_input_facet is depricated and will be phased out. use wtime_input_facet instead ptime_input_facet is depricated and will be phased out. use time_input_facet instead

Function Documentation

time_duration boost::posix_time::duration_from_string ( const std::string &  s)
inline

Creates a time_duration object from a delimited string.

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

References boost::asio::s.

ptime boost::posix_time::from_iso_string ( const std::string &  s)
inline

References boost::asio::s.

ptime boost::posix_time::from_time_t ( std::time_t  t)
inline

Function that converts a time_t into a ptime.

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

Adds a months object and a ptime.

Result will be same day-of-month as ptime unless original day was the last day of month. see date_time::months_duration for more details

References boost::date_time::base_time< T, time_system >::date(), and boost::date_time::months_duration< base_config >::get_offset().

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

Adds a years object and a ptime.

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

References boost::date_time::base_time< T, time_system >::date(), and boost::date_time::years_duration< base_config >::get_offset().

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

Adds a months object to a ptime.

Result will be same day-of-month as ptime unless original day was the last day of month. see date_time::months_duration for more details

References boost::date_time::base_time< T, time_system >::date(), and boost::date_time::months_duration< base_config >::get_offset().

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

Adds a years object to a ptime.

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

References boost::date_time::base_time< T, time_system >::date(), and boost::date_time::years_duration< base_config >::get_offset().

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

Subtracts a months object and a ptime.

Result will be same day-of-month as ptime unless original day was the last day of month. see date_time::months_duration for more details

References boost::date_time::base_time< T, time_system >::date(), and boost::date_time::months_duration< base_config >::get_neg_offset().

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

Subtracts a years object and a ptime.

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

References boost::date_time::base_time< T, time_system >::date(), and boost::date_time::years_duration< base_config >::get_neg_offset().

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

Subtracts a months object from a ptime.

Result will be same day-of-month as ptime unless original day was the last day of month. see date_time::months_duration for more details

References boost::date_time::base_time< T, time_system >::date(), and boost::date_time::months_duration< base_config >::get_neg_offset().

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

Subtracts a years object from a ptime.

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

References boost::date_time::base_time< T, time_system >::date(), and boost::date_time::years_duration< base_config >::get_neg_offset().

template<class CharT , class TraitsT >
std::basic_ostream<CharT, TraitsT>& boost::posix_time::operator<< ( std::basic_ostream< CharT, TraitsT > &  os,
const ptime &  p 
)
inline
template<class CharT , class TraitsT >
std::basic_ostream<CharT, TraitsT>& boost::posix_time::operator<< ( std::basic_ostream< CharT, TraitsT > &  os,
const boost::posix_time::time_period p 
)
inline
template<class CharT , class Traits >
std::basic_ostream<CharT, Traits>& boost::posix_time::operator<< ( std::basic_ostream< CharT, Traits > &  os,
const time_duration &  td 
)
inline

ostream operator for posix_time::time_duration

References boost::put().

template<class charT >
std::basic_istream<charT>& boost::posix_time::operator>> ( std::basic_istream< charT > &  is,
time_duration &  td 
)
inline

References boost::asio::b.

template<class CharT , class Traits >
std::basic_istream<CharT, Traits>& boost::posix_time::operator>> ( std::basic_istream< CharT, Traits > &  is,
ptime &  pt 
)
inline
template<class charT >
std::basic_istream<charT>& boost::posix_time::operator>> ( std::basic_istream< charT > &  is,
ptime &  pt 
)
inline
template<class charT >
std::basic_istream<charT>& boost::posix_time::operator>> ( std::basic_istream< charT > &  is,
time_period &  tp 
)
inline

operator>> for time_period.

time_period must be in "[date time_duration/date time_duration]" format.

References boost::end, boost::date_time::not_a_date_time, and boost::asio::s.

template<class CharT , class Traits >
std::basic_istream<CharT, Traits>& boost::posix_time::operator>> ( std::basic_istream< CharT, Traits > &  is,
time_period &  tp 
)
inline
template<class CharT , class Traits >
std::basic_istream<CharT, Traits>& boost::posix_time::operator>> ( std::basic_istream< CharT, Traits > &  is,
time_duration &  td 
)
inline
ptime boost::posix_time::ptime_from_tm ( const std::tm &  timetm)
inline

Convert a tm struct to a ptime ignoring is_dst flag.

References boost::gregorian::date_from_tm().

ptime boost::posix_time::time_from_string ( const std::string &  s)
inline

References boost::asio::s.

std::string boost::posix_time::to_iso_extended_string ( ptime  t)
inline

Convert to form YYYY-MM-DDTHH:MM:SS where T is the date-time separator.

References boost::flyweights::t.

template<class charT >
std::basic_string<charT> boost::posix_time::to_iso_extended_string_type ( ptime  t)
inline
std::wstring boost::posix_time::to_iso_extended_wstring ( ptime  t)
inline

Convert to form YYYY-MM-DDTHH:MM:SS where T is the date-time separator.

References boost::flyweights::t.

std::string boost::posix_time::to_iso_string ( time_duration  td)
inline

Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456.

std::string boost::posix_time::to_iso_string ( ptime  t)
inline

Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator.

References boost::flyweights::t.

template<class charT >
std::basic_string<charT> boost::posix_time::to_iso_string_type ( ptime  t)
inline
std::wstring boost::posix_time::to_iso_wstring ( time_duration  td)
inline

Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456.

std::wstring boost::posix_time::to_iso_wstring ( ptime  t)
inline

Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator.

References boost::flyweights::t.

std::string boost::posix_time::to_simple_string ( time_duration  td)
inline

Time duration to string -hh::mm::ss.fffffff. Example: 10:09:03.0123456.

std::string boost::posix_time::to_simple_string ( ptime  t)
inline

Time to simple format CCYY-mmm-dd hh:mm:ss.fffffff.

References boost::flyweights::t.

std::string boost::posix_time::to_simple_string ( time_period  tp)
inline

Convert to string of form [YYYY-mmm-DD HH:MM::SS.ffffff/YYYY-mmm-DD HH:MM::SS.fffffff].

template<class charT >
std::basic_string<charT> boost::posix_time::to_simple_string_type ( ptime  t)
inline
template<class charT >
std::basic_string<charT> boost::posix_time::to_simple_string_type ( time_period  tp)
inline
std::wstring boost::posix_time::to_simple_wstring ( time_duration  td)
inline

Time duration to wstring -hh::mm::ss.fffffff. Example: 10:09:03.0123456.

std::wstring boost::posix_time::to_simple_wstring ( ptime  t)
inline

References boost::flyweights::t.

std::wstring boost::posix_time::to_simple_wstring ( time_period  tp)
inline

Convert to wstring of form [YYYY-mmm-DD HH:MM::SS.ffffff/YYYY-mmm-DD HH:MM::SS.fffffff].

std::tm boost::posix_time::to_tm ( const boost::posix_time::ptime t)
inline
std::tm boost::posix_time::to_tm ( const boost::posix_time::time_duration td)
inline