Logo Search packages:      
Sourcecode: quantlib version File versions  Download package

Static Private Member Functions | Private Attributes | Related Functions

QuantLib::Date Class Reference

Concrete date class. More...

#include <date.hpp>

List of all members.

Public Member Functions

 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.
Weekday weekday () const
Day dayOfMonth () 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 by the given number of days
Dateoperator+= (const Period &)
 increments date by the given period
Dateoperator-= (BigInteger days)
 decrement date by the given number of days
Dateoperator-= (const Period &)
 decrements date by the given period
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 date incremented by the given number of days
Date operator+ (const Period &) const
 returns a new date incremented by the given period
Date operator- (BigInteger days) const
 returns a new date decremented by the given number of days
Date operator- (const Period &) const
 returns a new date decremented by the given period

Static Public Member Functions

static methods
static Date todaysDate ()
 today's date.
static Date minDate ()
 earliest allowed date
static Date maxDate ()
 latest allowed date
static bool isLeap (Year y)
 whether the given year is a leap one
static Date endOfMonth (const Date &d)
 last day of the month to which the given date belongs
static bool isEndOfMonth (const Date &d)
 whether a date is the last day of its month
static Date nextWeekday (const Date &d, Weekday w)
 next given weekday following or equal to the given date
static Date nthWeekday (Size n, Weekday w, Month m, Year y)
 n-th given weekday in the given month and year

Static Private Member Functions

static Date advance (const Date &d, Integer units, TimeUnit)
static void checkSerialNumber (BigInteger serialNumber)
static BigInteger maximumSerialNumber ()
static BigInteger minimumSerialNumber ()
static Integer monthLength (Month m, bool leapYear)
static Integer monthOffset (Month m, bool leapYear)
static BigInteger yearOffset (Year y)

Private Attributes

BigInteger serialNumber_

Related Functions

(Note that these are not member functions.)

bool operator!= (const Date &, const Date &)
BigInteger operator- (const Date &, const Date &)
 Difference in days between dates.
bool operator< (const Date &, const Date &)
std::ostream & operator<< (std::ostream &, 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 &)

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).

self-consistency of dates, serial numbers, days of month, months, and weekdays is checked over the whole date range.

Definition at line 89 of file date.hpp.

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

Generated by  Doxygen 1.6.0   Back to index