Date and Calendar Analytics
Calendar functions

functions for defining a calendar (holiday and weekend-conventions) for use in calendar and business date calculations. More...

Topics

 Country's Calendar functions
 A set of functions for exploring country-based calendar for use in calendar and business date calculations.
 
 Currency's Calendar functions
 A set of functions for exploring currency-based (aka., Bank) calendar for use in calendar and business date calculations.
 
 FX currency pair functions
 functions for exploring pre-defined FX currency-pair (combined) calendar for use in calendar and business date calculations.
 

Functions

int __stdcall SFDB_ISVALIDCALCODE (LPCTSTR argCode)
 Examine the given code whether it is a country, currency, or a built-in calendar.
 
int __stdcall SFDB_CALNAME (LPCTSTR argCode, LPTSTR retVal, size_t *nLen)
 returns the calendar name for given calendar code,
 
int __stdcall SFDB_CALENDARS (LPCTSTR argName, LPTSTR retVal, size_t *nLen, LPWORD nNumber)
 Return an array of names and codes for the supported calendars.
 
int __stdcall SFDB_CALHLDYS (LPCTSTR argCalCode, LPTSTR retVal, size_t *nLen, LPWORD nNumber)
 Return an array of the holidays' names and codes as defined for the given calendar.
 
int __stdcall SFDB_CALWKND (LPCTSTR argCalCode, LPWORD nWKNDNo)
 Return the weekend number associated with the given calendar.
 

Detailed Description

For financial time analysis, a calendar is a list of observed holidays and a weekend-day convention.

As of NumXL 1.56 (Zebra), the following calendars are supported:

country
United States (USA)
Code Description Holiday
USA US Federal Government Holidays
   NYD   
MLK
PRS
MEM
IND
LAB
COL
VET
THK
CHR
GDF
USD US Bank holidays calendar
   NYD   
MLK
PRS
MEM
IND
LAB
COL
VET
THK
CHR
Canada (CAN)
Code Description Holiday
CAD Canada Bank calendar
CAN-NYD
CAN-GDF
 CAN-VICTORIA 
CAN-CANADA
CAN-CIVIC
CAN-LABOR
CAN-THK
CAN-REM
CAN-CHR
CAN-BOX
European Union (EUC)
Code Description Holiday
EUR European Union Bank calendar
EUC-CHR
EUC-BOX
EUC-MAY
EUC-GDF
EUC-EAST
EUC-NYD
Switzerland (CHE)
Code Description Holiday
CHF Switzerland Bank calendar
CHE-BERCH
CHE-NYD
CHE-GDF
CHE-EAST
CHE-ANS
CHE-WHIT
CHE-NATIONAL
CHE-STEPHEN
CHE-CHR
Japan (JPN)
Code Description Holiday
JPY Japan Bank calendar
JPN-NYD
JPN-NYD2
JPN-NYD3
JPN-AGE
JPN-FOUND
   JPN-EQUINOX   
JPN-SHOWA
JPN-MEM
JPN-GREEN
JPN-CHILD
JPN-SEA
JPN-RESPECT
JPN-AUTEQUNOX
JPN-SPORT
JPN-CULTURE
JPN-LAB
JPN-EMPR
JPN-DEC31
Australia (AUS)
Code Description Holiday
AUD Australia Bank calendar
AUS-NYD
AUS-NATION
AUS-GDF
AUS-EAST
AUS-ANZAC
AUS-MISC
AUS-QUEEN
AUS-NSWHALES
AUS-LAB
AUS-BOX
AUS-CHR
AUS-CHRBOX
New Zealand (NZL)
Code Description Holiday
NZD New Zealad Bank calendar
NZL-NYD
NZL-NYD2
NZL-WAIT
NZL-EAST
NZL-ANZAC
NZL-QUEEN
NZL-LAB
NZL-CHR
NZL-BOX
Saudi Arabia (SAU)
Code Description Holiday
SAU Saudi Arabia public calendar
SAU-NATION
SAU-FITER
SAU-ADHA
Israel (ISR)
Code Description Holiday
ISR Israel public Holidays
ISR-PURIM
ISR-PESACHI
  ISR-PESACHVII  
ISR-HOLO
ISR-IND
ISR-PENT
ISR-TISHA
ISR-ROSH
ISR-KIPPUR
ISR-SUKKOT
Remarks
  1. As of NumXL 1.56 (Zebra), a calendar (code) can be used in place of holiday date(s) or holiday code(s)
  2. The public (i.e., government) calendar code of any country is the 3-character ISO code of the country (e.g., USA, GBR, NZL, CHE, etc.)
  3. The bank holiday calendar code is the 3-character ISO/SWIFT code of the currency (e.g., USD, GBP, NZD, CHF, etc.)
References
Related Links

Function Documentation

◆ SFDB_CALENDARS()

int __stdcall SFDB_CALENDARS ( LPCTSTR argName,
LPTSTR retVal,
size_t * nLen,
LPWORD nNumber )

Return an array of names and codes for the supported calendars.

Parameters
[in]argName(Required) the name or prefix of the calendar name. If missing, all supported calendars will be returned.
[out]retVal(Optional) The buffer that will receive the comma-separated calendar codes
[in,out]nLen(Required) The maximum number of characters to copy to the buffer.
[out]nNumber(Required) the number of matching calendars
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LENGTH_ERRORfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The list of calendar definitions can be found here.
  2. If the calendar module has not been initialized, the function will fail and return NDK_FAILED as the return code.
  3. The function is available in the lite (free) version without any restrictions.
  4. If the value of argCode is NULL or empty string, the function will fail and return NDK_INVALID_ARG as error code.
  5. If the value of nLen and nNumber are both NULL, the function will fail and return NDK_INVALID_ARG as error code.
  6. If retVal is NULL, the function returns NDK_SUCCESS and stores the required size of the data, in characters, in the variable pointed to by nLen. This enables an application to determine the best way to allocate a buffer for the value's data.
  7. If the value of the retVal is not NULL, but the buffer size (specififed by *nLen) is smaller than needed, the function will fail and return NDK_LENGTH_ERROR as error code.
Requirements
Requirement Value
Target Platform Windows
Header SFDBM.h (include Windows.h)
Library SFDBM.lib
DLL SFDBM.dll
SFLUC.dll
SFLOG.dll
Since
v1.56
See also

◆ SFDB_CALHLDYS()

int __stdcall SFDB_CALHLDYS ( LPCTSTR argCalCode,
LPTSTR retVal,
size_t * nLen,
LPWORD nNumber )

Returns an array of the holidays' names and codes as defined for the given calendar.

Parameters
[in]argCalCode(Required) the calendar code (e.g. US, NYSE, CBT), name or alias. If missing, the US Government calendar is used.
[out]retVal(Optional) the buffer that will receive the comma-separated holidays codes
[in,out]nLen(Required) The maximum number of characters to copy to the buffer.
[out]nNumber(Required) the number of holidays returned.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_LENGTH_ERRORfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The list of calendar definitions can be found here.
  2. If the calendar module has not been initialized, the function will fail and return NDK_FAILED as the return code.
  3. The function is available in the lite (free) version without any restrictions.
  4. If the value of argCalCode is NULL or empty string, the function will fail and return NDK_INVALID_ARG as error code.
  5. If the value of nLen and nNumber are both NULL, the function will fail and return NDK_INVALID_ARG as error code.
  6. If retVal is NULL, the function returns NDK_SUCCESS and stores the required size of the data, in characters, in the variable pointed to by nLen. This enables an application to determine the best way to allocate a buffer for the value's data.
  7. If the value of the retVal is not NULL, but the buffer size (specififed by *nLen) is smaller than needed, the function will fail and return NDK_LENGTH_ERROR as error code.
Requirements
Requirement Value
Target Platform Windows
Header SFDBM.h (include Windows.h)
Library SFDBM.lib
DLL SFDBM.dll
SFLUC.dll
SFLOG.dll
Since
v1.56
See also

◆ SFDB_CALNAME()

int __stdcall SFDB_CALNAME ( LPCTSTR argCode,
LPTSTR retVal,
size_t * nLen )

Returns the calendar name and description, given the calendar's short code (e.g., "US" will return "US Government Holidays").

Parameters
[in]argCode(Required) the calendar short code.
[out]retVal(Optional) The buffer that will receive the calendar name
[in,out]nLen(Required) The maximum number of characters to copy to the buffer.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_INVALID_VALUEfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The list of calendar definitions can be found here.
  2. If the calendar module has not been initialized, the function will fail and return NDK_FAILED as the return code.
  3. The function is available in the lite (free) version without any restrictions.
  4. If the value of argCode is NULL or empty string, the function will fail and return NDK_INVALID_ARG as error code.
  5. If the value of nLen is NULL, the function will fail and return NDK_INVALID_ARG as error code.
  6. If retVal is NULL, the function returns NDK_SUCCESS and stores the required size of the data, in characters, in the variable pointed to by nLen. This enables an application to determine the best way to allocate a buffer for the value's data.
  7. If the value of the retVal is not NULL, but the buffer size (specififed by *nLen) is smaller than needed, the function will fail and return NDK_LENGTH_ERROR as error code.
Requirements
Requirement Value
Target Platform Windows
Header SFDBM.h (include Windows.h)
Library SFDBM.lib
DLL SFDBM.dll
SFLUC.dll
SFLOG.dll
Since
v1.56
See also

◆ SFDB_CALWKND()

int __stdcall SFDB_CALWKND ( LPCTSTR argCalCode,
LPWORD nWKNDNo )

Returns the weekend number associated with the given calendar

Parameters
[in]argCalCode(Required) the calendar code (e.g. US, NYSE, CBT), name or alias. If missing, the US Government calendar is used.
[out]nWKNDNo(Required) the weekend number (1-7, 11-17).
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.
Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_INVALID_VALUEfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The list of calendar definitions can be found here.
  2. If the calendar module has not been initialized, the function will fail and return NDK_FAILED as the return code.
  3. The function is available in the lite (free) version without any restrictions.
  4. If the value of argCalCode is NULL or empty string, the function will fail and return NDK_INVALID_ARG as error code.
  5. If the value of nWKNDNo is NULL, the function will fail and return NDK_INVALID_ARG as error code.
Requirements
Requirement Value
Target Platform Windows
Header SFDBM.h (include Windows.h)
Library SFDBM.lib
DLL SFDBM.dll
SFLUC.dll
SFLOG.dll
Since
v1.56
See also

◆ SFDB_ISVALIDCALCODE()

int __stdcall SFDB_ISVALIDCALCODE ( LPCTSTR argCode)

examine the given code whether it is a country, currency, or a built-in calendar.

Parameters
[in]argCode(Required) the given calendar code.
Returns
status code of the function call: NDK_TRUE, NDK_FALSE, and negative = error occurred.
Return values
NDK_TRUEsuccess (TRUE)
NDK_FALSEsuccess (FALSE)
NDK_INVALID_ARGfailed (see remarks)
NDK_INVALID_VALUEfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The list of calendar definitions can be found here.
  2. If the calendar module has not been initialized, the function will fail and return NDK_FAILED as the return code.
  3. The function is available in the lite (free) version without any restrictions.
  4. If the value of argCode is NULL or empty string, the function will fail and return NDK_INVALID_ARG as error code.
Requirements
Requirement Value
Target Platform Windows
Header SFDBM.h (include Windows.h)
Library SFDBM.lib
DLL SFDBM.dll
SFLUC.dll
SFLOG.dll
Since
v1.56
See also