Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Class template partial_date

boost::date_time::partial_date — Generates a date by applying the year to the given month and day.

Synopsis

// In header: <boost/date_time/date_generators.hpp>

template<typename date_type> 
class partial_date : public  {
public:
  // types
  typedef     ;
  typedef      ;     
  typedef    ;   
  typedef     ;    
  typedef     ;
  typedef  ; 

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

  // public member functions
   () ;
   () ;
  bool (const partial_date &) ;
  bool (const partial_date &) ;
   () ;
   () ;
   () ;
};

Description

Example usage:

partial_date public construct/copy/destruct

  1. ( d,  m);
  2. ( days);
    Partial date created from number of days into year. Range 1-366.

    Allowable values range from 1 to 366. 1=Jan1, 366=Dec31. If argument exceeds range, partial_date will be created with closest in-range value. 60 will always be Feb29, if get_date() is called with a non-leap year an exception will be thrown

partial_date public member functions

  1.  ( y) ;
    Return a concrete date when provided with a year specific year.

    Will throw an 'invalid_argument' exception if a partial_date object, instantiated with Feb-29, has get_date called with a non-leap year. Example:

  2.  ( y) ;
  3. bool (const partial_date & rhs) ;
  4. bool (const partial_date & rhs) ;
  5.  () ;
  6.  () ;
  7.  () ;
    Returns string suitable for use in POSIX time zone string.

    Returns string formatted with up to 3 digits: Jan-01 == "0" Feb-29 == "58" Dec-31 == "365"


PrevUpHomeNext