![]() |
Home | Libraries | People | FAQ | More |
boost::date_time::date — Representation of timepoint at the one day level resolution.
// In header: <boost/date_time/date.hpp> template<typename T, typename calendar, typename duration_type_> class date : private { public: // types typedef T ; typedef calendar ; typedef ; typedef duration_type_ ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; typedef ; // construct/copy/destruct (, , ); (const ); (); (); // public member functions BOOST_CXX14_CONSTEXPR () ; BOOST_CXX14_CONSTEXPR () ; BOOST_CXX14_CONSTEXPR () ; BOOST_CXX14_CONSTEXPR () ; BOOST_CXX14_CONSTEXPR () ; BOOST_CONSTEXPR bool (const ) ; BOOST_CONSTEXPR bool (const ) ; BOOST_CONSTEXPR bool () ; BOOST_CONSTEXPR bool () ; BOOST_CONSTEXPR bool () ; BOOST_CONSTEXPR bool () ; BOOST_CONSTEXPR bool () ; BOOST_CXX14_CONSTEXPR () ; BOOST_CXX14_CONSTEXPR (const ) ; BOOST_CXX14_CONSTEXPR (const ) ; BOOST_CXX14_CONSTEXPR (const ); BOOST_CONSTEXPR () ; BOOST_CXX14_CONSTEXPR (const ) ; BOOST_CXX14_CONSTEXPR (const ); };
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 8601 systems. It provides basic operations to enable calculation and comparisons.
Theory
This 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.
date
public member functionsBOOST_CXX14_CONSTEXPR () ;
BOOST_CXX14_CONSTEXPR () ;
BOOST_CXX14_CONSTEXPR () ;
BOOST_CXX14_CONSTEXPR () ;
BOOST_CXX14_CONSTEXPR () ;
BOOST_CONSTEXPR bool (const rhs) ;
BOOST_CONSTEXPR bool (const rhs) ;
BOOST_CONSTEXPR bool () ;check to see if date is a special value
BOOST_CONSTEXPR bool () ;check to see if date is not a value
BOOST_CONSTEXPR bool () ;check to see if date is one of the infinity values
BOOST_CONSTEXPR bool () ;check to see if date is greater than all possible dates
BOOST_CONSTEXPR bool () ;check to see if date is greater than all possible dates
BOOST_CXX14_CONSTEXPR () ;return as a special value or a not_special if a normal date
BOOST_CXX14_CONSTEXPR (const d) ;
BOOST_CXX14_CONSTEXPR (const dd) ;
BOOST_CXX14_CONSTEXPR (const dd);
BOOST_CONSTEXPR () ;
BOOST_CXX14_CONSTEXPR (const dd) ;
BOOST_CXX14_CONSTEXPR (const dd);