Date Class Reference

#include <date.hpp>

List of all members.


Detailed Description

Concrete date class.

This class provides methods to inspect dates as well as methods and operators which implement a limited date algebra (increasing and decreasing dates, and calculating their difference).


Public Member Functions

constructors
 Date ()
 Default constructor returning a null date.

 Date (long serialNumber)
 Constructor taking a serial number as given by Applix or Excel.

 Date (Day d, Month m, Year y)
 More traditional constructor.

inspectors
Weekday weekday () const
Day dayOfMonth () const
bool isEndOfMonth () const
Day lastDayOfMonth () const
Day dayOfYear () const
 One-based (Jan 1st = 1).

Month month () const
Year year () const
long serialNumber () const
date algebra
Dateoperator+= (int days)
 increments date in place

Dateoperator-= (int days)
 decrement date in place

Dateoperator++ ()
 1-day pre-increment

Date operator++ (int)
 1-day post-increment

Dateoperator-- ()
 1-day pre-decrement

Date operator-- (int)
 1-day post-decrement

Date operator+ (int days) const
 returns a new incremented date

Date operator- (int days) const
 returns a new decremented date

other methods to increment/decrement dates
Date plusDays (int days) const
Date plusWeeks (int weeks) const
Date plusMonths (int months) const
Date plusYears (int years) const
Date plus (int units, TimeUnit) const
Date plus (const Period &) const

Static Public Member Functions

static methods
bool isLeap (Year y)
Date minDate ()
 earliest allowed date

Date maxDate ()
 latest allowed date

Date todaysDate ()
 today's date.


Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &, const Date &)
long operator- (const Date &, const Date &)
 Difference in days between dates.

bool operator== (const Date &, const Date &)
bool operator!= (const Date &, const Date &)
bool operator< (const Date &, const Date &)
bool operator<= (const Date &, const Date &)
bool operator> (const Date &, const Date &)
bool operator>= (const Date &, const Date &)


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

QuantLib.org
QuantLib
Hosted by
SourceForge.net Logo
Documentation generated by
doxygen