Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Date, Time, Timezone and Calendar manipulations

This module provides various calendar, timezone and date time services. More...

Namespaces

 boost::locale::period
 Namespace that contains various types for manipulation with dates.
 
 boost::locale::time_zone
 namespace that holds functions for operating with global time zone
 

Classes

class  boost::locale::date_time_error
 This error is thrown in case of invalid state that occurred. More...
 
struct  boost::locale::date_time_period
 This class represents a pair of period_type and the integer values that describes its amount. More...
 
class  boost::locale::date_time_period_set
 this class that represents a set of periods, More...
 
class  boost::locale::calendar
 this class provides an access to general calendar information. More...
 
class  boost::locale::date_time
 this class represents a date time and allows to perform various operation according to the locale settings. More...
 
class  boost::locale::date_time_duration
 This class represents a period: a pair of two date_time objects. More...
 

Functions

date_time_period_set boost::locale::operator+ (date_time_period_set const &a, date_time_period_set const &b)
 Append two periods sets. More...
 
date_time_period_set boost::locale::operator- (date_time_period_set const &a, date_time_period_set const &b)
 Append two period sets when all periods of set change their sign. More...
 
template<typename CharType >
std::basic_ostream< CharType > & boost::locale::operator<< (std::basic_ostream< CharType > &out, date_time const &t)
 Writes date_time t to output stream out. More...
 
template<typename CharType >
std::basic_istream< CharType > & boost::locale::operator>> (std::basic_istream< CharType > &in, date_time &t)
 Reads date_time t from output stream in. More...
 
date_time_duration boost::locale::operator- (date_time const &later, date_time const &earlier)
 Calculates the difference between two dates, the left operand is a later point on time line. More...
 

Detailed Description

This module provides various calendar, timezone and date time services.

Function Documentation

date_time_period_set boost::locale::operator+ ( date_time_period_set const &  a,
date_time_period_set const &  b 
)
inline
date_time_period_set boost::locale::operator- ( date_time_period_set const &  a,
date_time_period_set const &  b 
)
inline
date_time_duration boost::locale::operator- ( date_time const &  later,
date_time const &  earlier 
)
inline

#include <boost_1_57_0/boost/locale/date_time.hpp>

Calculates the difference between two dates, the left operand is a later point on time line.

Returns date_time_duration object.

template<typename CharType >
std::basic_ostream<CharType>& boost::locale::operator<< ( std::basic_ostream< CharType > &  out,
date_time const &  t 
)

#include <boost_1_57_0/boost/locale/date_time.hpp>

Writes date_time t to output stream out.

This function uses locale, calendar and time zone of the target stream in.

For example:

date_time now(time(0),hebrew_calendar)
cout << "Year: " << period::year(now) <<" Full Date:"<< now;

The output may be Year:5770 Full Date:Jan 1, 2010

References boost::locale::flags::date, boost::locale::flags::datetime, boost::locale::ios_info::display_flags(), boost::locale::ios_info::get(), boost::out, boost::locale::flags::strftime, boost::flyweights::t, and boost::locale::flags::time.

template<typename CharType >
std::basic_istream<CharType>& boost::locale::operator>> ( std::basic_istream< CharType > &  in,
date_time &  t 
)