Date

Overview

Date- and Period-related QuantLib functions.

Function List

qlASXIsASXcode ()
qlASXIsASXdate ()
qlASXNextCode ()
qlASXNextCodes ()
qlASXNextDate ()
qlASXNextDates ()
qlASXcode ()
qlASXdate ()
qlDateEndOfMonth ()
qlDateIsEndOfMonth ()
qlDateIsLeap ()
qlDateMaxDate ()
qlDateMinDate ()
qlDateNextWeekday ()
qlDateNthWeekday ()
qlECBAddDate ()
qlECBIsECBcode ()
qlECBIsECBdate ()
qlECBKnownDates ()
qlECBNextCode ()
qlECBNextCode2 ()
qlECBNextDate ()
qlECBNextDate2 ()
qlECBNextDates ()
qlECBRemoveDate ()
qlECBcode ()
qlECBdate ()
qlECBdate2 ()
qlFrequencyFromPeriod ()
qlIMMIsIMMcode ()
qlIMMIsIMMdate ()
qlIMMNextCode ()
qlIMMNextCodes ()
qlIMMNextDate ()
qlIMMNextDates ()
qlIMMcode ()
qlIMMdate ()
qlPeriodEquivalent ()
qlPeriodFromFrequency ()
qlPeriodLessThan ()

Function Documentation

qlASXIsASXcode

vector<bool> returnValue
qlASXIsASXcode(
vector<string> Code
bool MainCycle
any Trigger)
Description:

returns whether or not the given code is an ASX code.

Supported Platforms:

Excel

Parameters
Code2 letter string (e.g. M5).
MainCycleFALSE to consider all futures (serial ones included), not just the main March/June/September/December (H, M, U, Z) cycle. Default value = true.
Triggerdependency tracking trigger

qlASXIsASXdate

vector<bool> returnValue
qlASXIsASXdate(
vector<long> Date
bool MainCycle
any Trigger)
Description:

returns whether or not the given date is an ASX date.

Supported Platforms:

Excel

Parameters
Datedate.
MainCycleTRUE to consider the main March/June/September/December (H, M, U, Z) cycle only. Default value = true.
Triggerdependency tracking trigger

qlASXNextCode

string returnValue
qlASXNextCode(
long RefDate
bool MainCycle
any Trigger)
Description:

returns the code for the first contract listed in the Australian Securities Exchange.

Supported Platforms:

Excel

Parameters
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
MainCycleTRUE to consider the main March/June/September/December (H, M, U, Z) cycle only. Default value = true.
Triggerdependency tracking trigger

qlASXNextCodes

vector<string> returnValue
qlASXNextCodes(
long RefDate
vector<bool> MainCycle
any Trigger)
Description:

returns the codes for the next contracts listed in the Australian Securities Exchange.

Supported Platforms:

Excel

Parameters
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
MainCycleTRUE to consider the main March/June/September/December (H, M, U, Z) cycle only. Default value = std::vector<bool>(40, true).
Triggerdependency tracking trigger

qlASXNextDate

long returnValue
qlASXNextDate(
long RefDate
bool MainCycle
any Trigger)
Description:

returns the delivery date for the first contract listed in the Australian Securities Exchange.

Supported Platforms:

Excel

Parameters
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
MainCycleTRUE to consider the main March/June/September/December (H, M, U, Z) cycle only. Default value = true.
Triggerdependency tracking trigger

qlASXNextDates

vector<long> returnValue
qlASXNextDates(
long RefDate
vector<bool> MainCycle
any Trigger)
Description:

returns the delivery dates for the next contracts listed in the Australian Securities Exchange.

Supported Platforms:

Excel

Parameters
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
MainCycleTRUE to consider the main March/June/September/December (H, M, U, Z) cycle only. Default value = std::vector<bool>(40, true).
Triggerdependency tracking trigger

qlASXcode

vector<string> returnValue
qlASXcode(
vector<long> ASXdate
any Trigger)
Description:

returns the code corresponding to a given ASX date (e.g. H5 for Friday, March 13th, 2015). It fails if the input date is not an ASX date.

Supported Platforms:

Excel

Parameters
ASXdateASX date.
Triggerdependency tracking trigger

qlASXdate

vector<long> returnValue
qlASXdate(
vector<string> ASXcode
long RefDate
any Trigger)
Description:

returns the ASX date corresponding to the given ASX code (e.g. Friday, March 13th, 2015 for H5)).

Supported Platforms:

Excel

Parameters
ASXcode2 letter ASX code (e.g. M5).
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
Triggerdependency tracking trigger

qlDateEndOfMonth

vector<long> returnValue
qlDateEndOfMonth(
vector<long> Date
any Trigger)
Description:

returns the last day of the month to which the given date belongs.

Supported Platforms:

Excel

Parameters
Datedate.
Triggerdependency tracking trigger

qlDateIsEndOfMonth

vector<bool> returnValue
qlDateIsEndOfMonth(
vector<long> Date
any Trigger)
Description:

returns TRUE if a date is the last day of its month.

Supported Platforms:

Excel

Parameters
Datedate.
Triggerdependency tracking trigger

qlDateIsLeap

vector<bool> returnValue
qlDateIsLeap(
vector<long> Year
any Trigger)
Description:

returns TRUE if a year is leap.

Supported Platforms:

Excel

Parameters
Yearyear (e.g. 2006).
Triggerdependency tracking trigger

qlDateMaxDate

long returnValue
qlDateMaxDate(
any Trigger)
Description:

returns the latest date allowed in QuantLib.

Supported Platforms:

Excel

Parameters
Triggerdependency tracking trigger

qlDateMinDate

long returnValue
qlDateMinDate(
any Trigger)
Description:

returns the earliest date allowed in QuantLib.

Supported Platforms:

Excel

Parameters
Triggerdependency tracking trigger

qlDateNextWeekday

vector<long> returnValue
qlDateNextWeekday(
vector<long> Date
string Weekday
any Trigger)
Description:

Returns the next given weekday following or equal to the given date (e.g., the Friday following Tuesday, January 15th, 2002 was January 18th, 2002).

Supported Platforms:

Excel

Parameters
Datedate.
WeekdayWeekday (e.g. Wednesday, or Wed).
Triggerdependency tracking trigger

qlDateNthWeekday

long returnValue
qlDateNthWeekday(
long Nth
string Weekday
string Month
long Year
any Trigger)
Description:

Returns the n-th given weekday in the given month and year (e.g., the 4th Thursday of March, 1998 was March 26th, 1998).

Supported Platforms:

Excel

Parameters
Nthordinal number (greater than zero, less than 6).
WeekdayWeekday (e.g. Wednesday, or Wed).
MonthMonth (e.g. January, or Jan, or '1').
Yearyear (e.g. 2007).
Triggerdependency tracking trigger

qlECBAddDate

void returnValue
qlECBAddDate(
long Date
any Trigger)
Description:

add an ECB date to the list of known ECB dates.

Supported Platforms:

Excel

Parameters
Dateto be added to the list of known ECB dates.
Triggerdependency tracking trigger

qlECBIsECBcode

vector<bool> returnValue
qlECBIsECBcode(
vector<string> Code
any Trigger)
Description:

returns whether or not the given code is an ECB code.

Supported Platforms:

Excel

Parameters
Code5 letter ECB code (e.g. MAR10).
Triggerdependency tracking trigger

qlECBIsECBdate

vector<bool> returnValue
qlECBIsECBdate(
vector<long> Date
any Trigger)
Description:

returns whether or not the given date is an ECB maintenance period start date.

Supported Platforms:

Excel

Parameters
Datedate.
Triggerdependency tracking trigger

qlECBKnownDates

vector<long> returnValue
qlECBKnownDates(
any Trigger)
Description:

returns all the known ECB maintenance period start dates.

Supported Platforms:

Excel

Parameters
Triggerdependency tracking trigger

qlECBNextCode

string returnValue
qlECBNextCode(
long RefDate
any Trigger)
Description:

returns the code for the first ECB date.

Supported Platforms:

Excel

Parameters
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
Triggerdependency tracking trigger

qlECBNextCode2

string returnValue
qlECBNextCode2(
string Code
any Trigger)
Description:

returns the code for the next ECB date.

Supported Platforms:

Excel

Parameters
Code5 letter ECB code (e.g. MAR10).
Triggerdependency tracking trigger

qlECBNextDate

long returnValue
qlECBNextDate(
long Date
any Trigger)
Description:

returns the next ECB maintenance period start date following the given date.

Supported Platforms:

Excel

Parameters
Datedate with respect to which the calculations are performed. Default value = QuantLib::Date().
Triggerdependency tracking trigger

qlECBNextDate2

long returnValue
qlECBNextDate2(
string Code
any Trigger)
Description:

returns the next ECB maintenance period start date following the given date.

Supported Platforms:

Excel

Parameters
Code5 letter ECB code (e.g. MAR10).
Triggerdependency tracking trigger

qlECBNextDates

vector<long> returnValue
qlECBNextDates(
long Date
any Trigger)
Description:

returns all the known ECB maintenance period start dates following the given date.

Supported Platforms:

Excel

Parameters
Datedate with respect to which the calculations are performed. Default value = QuantLib::Date().
Triggerdependency tracking trigger

qlECBRemoveDate

void returnValue
qlECBRemoveDate(
long Date
any Trigger)
Description:

remove an ECB date from the list of known ECB dates.

Supported Platforms:

Excel

Parameters
Dateto be removed from the list of known ECB dates.
Triggerdependency tracking trigger

qlECBcode

string returnValue
qlECBcode(
long ECBdate
any Trigger)
Description:

returns the code corresponding to a given ECB date (e.g. MAR10 for Wednesday, March xxth, 2010). It fails if the input date is not an ECB date.

Supported Platforms:

Excel

Parameters
ECBdateECB date.
Triggerdependency tracking trigger

qlECBdate

long returnValue
qlECBdate(
string ECBcode
long RefDate
any Trigger)
Description:

returns the ECB maintenance period start date for the given ECB code.

Supported Platforms:

Excel

Parameters
ECBcode5 letter ECB code (e.g. MAR10).
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
Triggerdependency tracking trigger

qlECBdate2

long returnValue
qlECBdate2(
string Month
long Year
any Trigger)
Description:

returns the ECB maintenance period start date in the given month/year.

Supported Platforms:

Excel

Parameters
Monthmonth (e.g. January, or Jan, or '1').
Yearyear (e.g. 2010).
Triggerdependency tracking trigger

qlFrequencyFromPeriod

vector<string> returnValue
qlFrequencyFromPeriod(
vector<string> Period
any Trigger)
Description:

returns a Frequency from a given Period (e.g. SemiAnnual from 6M).

Supported Platforms:

Excel

Parameters
Periodperiod(s) to advance (e.g. 2D for two days , 3W for three weeks, 6M for six months, 1Y for one year).
Triggerdependency tracking trigger

qlIMMIsIMMcode

vector<bool> returnValue
qlIMMIsIMMcode(
vector<string> Code
bool MainCycle
any Trigger)
Description:

returns whether or not the given code is an IMM code.

Supported Platforms:

Excel

Parameters
Code2 letter string (e.g. H6).
MainCycleFALSE to consider all futures (serial ones included), not just the main March/June/September/December (H, M, U, Z) cycle. Default value = true.
Triggerdependency tracking trigger

qlIMMIsIMMdate

vector<bool> returnValue
qlIMMIsIMMdate(
vector<long> Date
bool MainCycle
any Trigger)
Description:

returns whether or not the given date is an IMM date.

Supported Platforms:

Excel

Parameters
Datedate.
MainCycleTRUE to consider the main March/June/September/December (H, M, U, Z) cycle only. Default value = true.
Triggerdependency tracking trigger

qlIMMNextCode

string returnValue
qlIMMNextCode(
long RefDate
bool MainCycle
any Trigger)
Description:

returns the code for the first contract listed in the International Money Market section of the Chicago Mercantile Exchange.

Supported Platforms:

Excel

Parameters
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
MainCycleTRUE to consider the main March/June/September/December (H, M, U, Z) cycle only. Default value = true.
Triggerdependency tracking trigger

qlIMMNextCodes

vector<string> returnValue
qlIMMNextCodes(
long RefDate
vector<bool> MainCycle
any Trigger)
Description:

returns the codes for the next contracts listed in the International Money Market section of the Chicago Mercantile Exchange.

Supported Platforms:

Excel

Parameters
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
MainCycleTRUE to consider the main March/June/September/December (H, M, U, Z) cycle only. Default value = std::vector<bool>(40, true).
Triggerdependency tracking trigger

qlIMMNextDate

long returnValue
qlIMMNextDate(
long RefDate
bool MainCycle
any Trigger)
Description:

returns the delivery date for the first contract listed in the International Money Market section of the Chicago Mercantile Exchange.

Supported Platforms:

Excel

Parameters
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
MainCycleTRUE to consider the main March/June/September/December (H, M, U, Z) cycle only. Default value = true.
Triggerdependency tracking trigger

qlIMMNextDates

vector<long> returnValue
qlIMMNextDates(
long RefDate
vector<bool> MainCycle
any Trigger)
Description:

returns the delivery dates for the next contracts listed in the International Money Market section of the Chicago Mercantile Exchange.

Supported Platforms:

Excel

Parameters
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
MainCycleTRUE to consider the main March/June/September/December (H, M, U, Z) cycle only. Default value = std::vector<bool>(40, true).
Triggerdependency tracking trigger

qlIMMcode

vector<string> returnValue
qlIMMcode(
vector<long> IMMdate
any Trigger)
Description:

returns the code corresponding to a given IMM date (e.g. H5 for Wednesday, March 18th, 2015). It fails if the input date is not an IMM date.

Supported Platforms:

Excel

Parameters
IMMdateIMM date.
Triggerdependency tracking trigger

qlIMMdate

vector<long> returnValue
qlIMMdate(
vector<string> IMMcode
long RefDate
any Trigger)
Description:

returns the IMM date corresponding to the given IMM code (e.g. Wednesday, March 18th, 2015 for H5).

Supported Platforms:

Excel

Parameters
IMMcode2 letter IMM code (e.g. H6).
RefDatedate with respect to which the calculations are performed. Default value = QuantLib::Date().
Triggerdependency tracking trigger

qlPeriodEquivalent

string returnValue
qlPeriodEquivalent(
string Period
any Trigger)
Description:

Returns the period equivalent to the input (e.g. 11M for 1Y-1M).

Supported Platforms:

Excel

Parameters
Periodinput period (e.g. 1Y-1M).
Triggerdependency tracking trigger

qlPeriodFromFrequency

string returnValue
qlPeriodFromFrequency(
string Frequency
any Trigger)
Description:

returns a Period from a given Frequency (e.g. 6M from SemiAnnual).

Supported Platforms:

Excel

Parameters
Frequencyfrequency (e.g. Annual, Semiannual, Every4Month, Quarterly, Bimonthly, Monthly).
Triggerdependency tracking trigger

qlPeriodLessThan

bool returnValue
qlPeriodLessThan(
string Period1
string Period2
any Trigger)
Description:

Returns TRUE if the first period is less than the second.

Supported Platforms:

Excel

Parameters
Period1left hand side.
Period2right hand side.
Triggerdependency tracking trigger