Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class date

boost::gregorian::date — A date type based on gregorian_calendar.

Synopsis

// In header: <boost/date_time/gregorian/greg_date.hpp>


class date : public  {
public:
  // types
  typedef         ;       
  typedef        ;      
  typedef          ;        
  typedef  ;
  typedef          ;        
  typedef     ;   
  typedef     ;   
  typedef date_duration                        ;   

  // construct/copy/destruct
  ();
  (, , );
  ();
  ();
  ();
  ();

  // public member functions
   () ;
   () ;
   () ;
   () ;
   () ;
  date () ;

  // private member functions
   ();
};

Description

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.

date public construct/copy/destruct

  1. ();
    Default constructor constructs with not_a_date_time.
  2. ( y,  m,  d);
    Main constructor with year, month, day.
  3. ( ymd);
    Constructor from a ymd_type structure.
  4. ( rhs);
    Needed copy constructor.
  5. ( rhs);
    Needed copy constructor.
  6. ( sv);
    Constructor for infinities, not a date, max and min date.

date public member functions

  1.  () ;
    Return the Julian Day number for the date.
  2.  () ;
    Return the day of year 1..365 or 1..366 (for leap year)
  3.  () ;
    Return the Modified Julian Day number for the date.
  4.  () ;
    Return the ISO 8601 week number 1..53.
  5.  () ;
    Return the day number from the calendar.
  6. date () ;
    Return the last day of the current month.

date private member functions

  1.  ( sv);

PrevUpHomeNext