SysTutorials

Linux Manual Pages › Section 3

todaysdate(3)

QuantLib::Date – Concrete date class.

Synopsis

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
Related Functions
(Note that these are not member functions.)
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 &)
std::ostream & operator<< (std::ostream &, const Date &)

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

Related Functions

(Note that these are not member functions.)

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

std::ostream & operator<< (std::ostream &, const Date &) date algebra
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

Related Functions

(Note that these are not member functions.)

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

std::ostream & operator<< (std::ostream &, const Date &) 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
Related Functions
(Note that these are not member functions.)
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 &)
std::ostream & operator<< (std::ostream &, 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).

Tests

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

Examples:

BermudanSwaption.cpp, Bonds.cpp, CallableBonds.cpp, CDS.cpp, ConvertibleBonds.cpp, DiscreteHedging.cpp, EquityOption.cpp, FittedBondCurve.cpp, FRA.cpp, Replication.cpp, Repo.cpp, and swapvaluation.cpp.

Member Function Documentation

static Date nextWeekday (const Date & d, Weekday w) [static]

next given weekday following or equal to the given date

E.g., the Friday following Tuesday, January 15th, 2002 was January 18th, 2002.

see http://www.cpearson.com/excel/DateTimeWS.htm

static Date nthWeekday (Size n, Weekday w, Month m, Year y) [static]

n-th given weekday in the given month and year

E.g., the 4th Thursday of March, 1998 was March 26th, 1998.

see http://www.cpearson.com/excel/DateTimeWS.htm

Friends And Related Function Documentation

bool operator== (const Date &, const Date &) [related]

bool operator!= (const Date &, const Date &) [related]

bool operator< (const Date &, const Date &) [related]

bool operator<= (const Date &, const Date &) [related]

bool operator> (const Date &, const Date &) [related]

bool operator>= (const Date &, const Date &) [related]

std::ostream & operator<< (std::ostream &, const Date &) [related]

Author

Generated automatically by Doxygen for QuantLib from the source code.