Date Class Reference
[Date and time calculations]

#include <ql/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 (BigInteger 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
BigInteger serialNumber () const
date algebra
Dateoperator+= (BigInteger days)
 increments date in place

Dateoperator-= (BigInteger 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+ (BigInteger days) const
 returns a new incremented date

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

other methods to increment/decrement dates
Date plusDays (Integer days) const
Date plusWeeks (Integer weeks) const
Date plusMonths (Integer months) const
Date plusYears (Integer years) const
Date plus (Integer 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 &)
BigInteger 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 &)


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