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

A date type based on gregorian_calendar. More...

#include <greg_date.hpp>

Inheritance diagram for boost::gregorian::date:
Collaboration diagram for boost::gregorian::date:

Public Types

typedef
gregorian_calendar::year_type 
year_type
 
typedef
gregorian_calendar::month_type 
month_type
 
typedef
gregorian_calendar::day_type 
day_type
 
typedef
gregorian_calendar::day_of_year_type 
day_of_year_type
 
typedef
gregorian_calendar::ymd_type 
ymd_type
 
typedef
gregorian_calendar::date_rep_type 
date_rep_type
 
typedef
gregorian_calendar::date_int_type 
date_int_type
 
typedef date_duration duration_type
 
typedef date date_type
 
typedef gregorian_calendar calendar_type
 
typedef
gregorian_calendar::date_traits_type 
traits_type
 
typedef
gregorian_calendar::day_of_week_type 
day_of_week_type
 

Public Member Functions

 date ()
 Default constructor constructs with not_a_date_time. More...
 
 date (year_type y, month_type m, day_type d)
 Main constructor with year, month, day. More...
 
 date (const ymd_type &ymd)
 Constructor from a ymd_type structure. More...
 
 date (const date_int_type &rhs)
 Needed copy constructor. More...
 
 date (date_rep_type rhs)
 Needed copy constructor. More...
 
 date (special_values sv)
 Constructor for infinities, not a date, max and min date. More...
 
date_int_type julian_day () const
 Return the Julian Day number for the date. More...
 
day_of_year_type day_of_year () const
 Return the day of year 1..365 or 1..366 (for leap year) More...
 
date_int_type modjulian_day () const
 Return the Modified Julian Day number for the date. More...
 
int week_number () const
 Return the iso 8601 week number 1..53. More...
 
date_int_type day_number () const
 Return the day number from the calendar. More...
 
date end_of_month () const
 Return the last day of the current month. More...
 
year_type year () const
 
month_type month () const
 
day_type day () const
 
day_of_week_type day_of_week () const
 
ymd_type year_month_day () const
 
bool operator< (const date_type &rhs) const
 
bool operator== (const date_type &rhs) const
 
bool is_special () const
 check to see if date is a special value More...
 
bool is_not_a_date () const
 check to see if date is not a value More...
 
bool is_infinity () const
 check to see if date is one of the infinity values More...
 
bool is_pos_infinity () const
 check to see if date is greater than all possible dates More...
 
bool is_neg_infinity () const
 check to see if date is greater than all possible dates More...
 
special_values as_special () const
 return as a special value or a not_special if a normal date More...
 
duration_type operator- (const date_type &d) const
 
date_type operator- (const duration_type &dd) const
 
date_type operator-= (const duration_type &dd)
 
date_rep_type day_count () const
 
date_type operator+ (const duration_type &dd) const
 
date_type operator+= (const duration_type &dd)
 

Protected Attributes

date_int_type days_
 

Detailed Description

A date type based on gregorian_calendar.

This class is the primary interface for programming with greogorian dates. The is a lightweight type that can be freely passed by value. All comparison operators are supported.

Member Typedef Documentation

Constructor & Destructor Documentation

boost::gregorian::date::date ( )
inline

Default constructor constructs with not_a_date_time.

Referenced by date(), and end_of_month().

boost::gregorian::date::date ( year_type  y,
month_type  m,
day_type  d 
)
inline

Main constructor with year, month, day.

boost::gregorian::date::date ( const ymd_type ymd)
inlineexplicit

Constructor from a ymd_type structure.

boost::gregorian::date::date ( const date_int_type rhs)
inlineexplicit

Needed copy constructor.

boost::gregorian::date::date ( date_rep_type  rhs)
inlineexplicit

Needed copy constructor.

boost::gregorian::date::date ( special_values  sv)
inlineexplicit

Constructor for infinities, not a date, max and min date.

References date(), boost::date_time::max_date_time, and boost::date_time::min_date_time.

Member Function Documentation

special_values boost::date_time::date< date , gregorian_calendar , date_duration >::as_special ( ) const
inlineinherited

return as a special value or a not_special if a normal date

References boost::date_time::date< T, calendar, duration_type_ >::days_.

date_int_type boost::gregorian::date::day_number ( ) const
inline

Return the day number from the calendar.

References boost::date_time::date< date, gregorian_calendar, date_duration >::days_.

day_of_year_type boost::gregorian::date::day_of_year ( ) const
inline

Return the day of year 1..365 or 1..366 (for leap year)

References boost::date_time::date< date, gregorian_calendar, date_duration >::year().

Referenced by boost::gregorian::to_tm().

bool boost::date_time::date< date , gregorian_calendar , date_duration >::is_infinity ( ) const
inlineinherited

check to see if date is one of the infinity values

References boost::date_time::date< T, calendar, duration_type_ >::days_.

bool boost::date_time::date< date , gregorian_calendar , date_duration >::is_neg_infinity ( ) const
inlineinherited

check to see if date is greater than all possible dates

References boost::date_time::date< T, calendar, duration_type_ >::days_.

bool boost::date_time::date< date , gregorian_calendar , date_duration >::is_not_a_date ( ) const
inlineinherited

check to see if date is not a value

References boost::date_time::date< T, calendar, duration_type_ >::days_.

bool boost::date_time::date< date , gregorian_calendar , date_duration >::is_pos_infinity ( ) const
inlineinherited

check to see if date is greater than all possible dates

References boost::date_time::date< T, calendar, duration_type_ >::days_.

Member Data Documentation

Referenced by day_number().


The documentation for this class was generated from the following file: