Date and Calendar Analytics
Holidays functions

functions for exploring holidays and incorporating into calendar and business date calculations. More...

Functions

int __stdcall SFDB_ISVALIDHLDYCODE (LPCTSTR argHoliday)
 Examine the validity of the given code as a holiday code (TRUE/FALSE).
 
int __stdcall SFDB_HLDYS (LPCTSTR argPrefix, LPTSTR retVal, size_t *nLen)
 Search for and provide a list of holiday codes that match the specified prefix.
 
int __stdcall SFDB_FindHLDY (LONG argDate, LPCTSTR argHolidays, LPTSTR retVal, size_t *nLen)
 Return the holiday code that falls on the given date.
 
int __stdcall SFDB_HLDYName (LPCTSTR code, LPTSTR retVal, size_t *nLen)
 Returns the full name of the holiday that corresponds to the given short code.
 
int __stdcall SFDB_HLDYDate (LONG argDate, LPLONG zDates, size_t nLen, LPCTSTR argHolidays, WORD retType, LPLONG retVal)
 Return the date serial number that represents the holiday in the given year.
 
int __stdcall SFDB_ISHLDY (LONG argDate, LPLONG zDates, size_t nLen, LPCTSTR argHolidays)
 Determine if the specified date falls on a holiday (TRUE/FALSE).
 
int __stdcall SFDB_HLDYDates (LONG argStartDate, LONG argEndDate, LPLONG zDates, size_t nLen, LPCTSTR szHolidays, LPLONG retVal, size_t *nSize)
 Return an array of serial date numbers that represent observed holidays between the two given dates.
 
int __stdcall SFDB_ONEHLDYDates (LONG argStartDate, LONG argEndDate, LPCTSTR szHoliday, LPLONG retVal, size_t *nSize)
 Generate an array of serial date numbers for the given holiday between two specified dates.
 

Detailed Description

A holiday is a day designated as having special significance for individuals, governments or religious groups. Typically, a holiday does not necessarily exclude doing normal work but for our purposes, NumXL assumes all supported holidays (e.g. National Holidays) exclude normal work.

Observed holidays and actual dates for particular holidays (e.g. Easter) may vary between countries, so in NumXL a holiday code is prefixed by the country ISO code (e.g. USA, CAN, GBR, etc.).

As of version 1.56 (Zebra), NumXL supports 117 different holidays in the following 10 countries:

country
United Stated (USA)
Code Description
USA-NYD New Year’s Day
USA-MLK Birthday of Martin Luther King, Jr.
USA-PRS Birthday of George Washington
USA-MEM US Memorial Day
USA-IND US Independence Day
USA-LAB US Labor Day
USA-COL Columbus Day
USA-VET US Veterans Day
USA-THK US Thanksgiving Day
USA-CHR Christmas Day
USA-GDF US Good Friday
Canada
Code Description
CAN-NYD New Year's Day in Canada
CAN-GDF Good Friday in Canada
CAN-VICTORIA Victoria Day in Canada
CAN-CANADA Canada Day
CAN-CIVIC Civic/Provincial Day in Canada   
CAN-LABOR Labour Day in Canada
CAN-THK Thanksgiving Day in Canada
CAN-REM Remembrance Day in Canada
CAN-CHR Christmas in Canada
CAN-BOX Boxing Day in Canada
EU countries
Code Description
EUC-CHR Christmas Day
EUC-BOX Boxing Day
EUC-MAY May Day
EUC-GDF Good Friday
EUC-EAST Easter Monday
EUC-NYD New year - Unadjusted
Great Britain (GBR)
Code Description
GBR-NYD New Years in Britain
GBR-GDF Good Friday
GBR-EAST Easter Monday
GBR-MISC Royal Wedding Bank Holiday
GBR-EMAY Early May Bank Holiday
GBR-MAY Spring Bank Holiday
GBR-SUMMER Summer Bank Holiday
GBR-BOX Boxing Day
GBR-CHR Christmas
GBR-MISCBABK Bank Holiday
Switzerland (CHE)
Code Description
CHE-BERCH Berchtold Day
CHE-NYD New Year's day
CHE-GDF Good Friday
CHE-EAST Easter Monday
CHE-MAY May Day in Switzerland
CHE-ANS Ascension Day
CHE-WIT Whit Monday
CHE-NATIONAL Swiss National Day
CHE-STEPHEN St. Stephen's Day in Switzerland
CHE-CHR Christmas Day
Japan (JPN)
Code Description
JPN-NYD New Year's Day
JPN-NYD2 January 2
JPN-NYD3 January 3
JPN-AGE Coming of Age Day in Japan
JPN-FOUND National Foundation Day
JPN-EQUINOX Spring Equinox in Japan
JPN-SHOWA Shōwa Day in Japan
JPN-MEM Constitution Memorial Day in Japan
JPN-GREEN Greenery Day in Japan
JPN-CHILD Children's Day in Japan
JPN-SEA Sea Day in Japan
JPN-RESPECT Respect for the Aged Day in Japan
JPN-AUTEQUINOX Autumn Equinox in Japan
JPN-SPORT Sports Day in Japan
JPN-CULTURE Culture Day in Japan
JPN-LAB Labor Thanksgiving Day in Japan
JPN-EMPR Emperor's Birthday in Japan
JPN-DEC31 December 31 Bank Holiday
Australia (AUS)
Code Description
AUS-NYD New Year's Day in Australia
AUS-NATION Australia Day in Australia
AUS-GDF Good Friday in Australia
AUS-EAST Easter Monday in Australia
AUS-ANZAC Anzac Day in Australia
AUS-MISC Additional Public Holiday in Australia
AUS-QUEEN Queen's Birthday in Australia
AUS-NSWALES New South Wales Bank Holiday in Australia
AUS-LAB Labour Day in Australia
AUS-BOX Boxing Day in Australia
AUS-CHR Christmas Day in Australia
AUS-CHRBOX Christmas/Boxing Day Holiday in Australia
New Zealand (NZL)
Code Description
NZL-NYD New Year's Day in New Zealand
NZL-NYD2 Day after New Year's Day in New Zealand
NZL-WAIT Waitangi Day in New Zealand
NZL-GDF Good Friday in New Zealand
NZL-EAST Easter Monday in New Zealand
NZL-ANZAC Anzac Day in New Zealand
NZL-QUEEN Queen's Birthday in New Zealand
NZL-LAB Labour Day in New Zealand
NZL-CHR Christmas Day in New Zealand
NZL-BOX Boxing Day in New Zealand
Saudi Arabia (SAU)
Code Description
SAU-NATION Saudi National Day in Saudi Arabia
SAU-FITR Eid-al-Fitr
SAU-ADHA EID EL-ADHA
Israel (ISR)
Code Description
SAU-NATION Saudi National Day in Saudi Arabia
ISR-PURIM Purim (Deliverance of the Jews) in Israel
ISR-PESACHI Pesach I (First day of Passover) in Israel
ISR-PESACHVII/td> Pesach VII (Last day of Passover) in Israel
ISR-HOLO Holocaust Memorial Day in Israel
ISR-MEM Memorial Day in Israel
ISR-IND Independence Day in Israel
ISR-PENT Shavuot (Pentecost) in Israel
ISR-TISHA Tisha B'Av in Israel
ISR-ROSH Rosh Hashana (New Year) in Israel
ISR-KIPPUR Yom Kippur in Israel
ISR-SUKKOT Sukkot I in Israel
ISR-SIMCHAT Simchat Torah
ISR-CHANUKAH Holiday of lights (Chanukah)
Remarks
  1. A holiday may span multiple days (e.g., EIDS for Muslims).
  2. The holiday code follows a "(COUNTRY [—/:]) CODE" convention, where the country (optional) is denoted by a 3-character ISO code (e.g., GBR, CAN, etc.).
  3. If a holiday code is given without a country prefix, The default of USA is assumed.
References
Related Links

Function Documentation

◆ SFDB_FindHLDY()

int __stdcall SFDB_FindHLDY ( LONG argDate,
LPCTSTR argHolidays,
LPTSTR retVal,
size_t * nLen )

Returns the holiday code that falls on the given date

Parameters
[in]argDate(Required) The serial date number that represents the given date
[in]argHolidays(Required) the holiday name/prefix to search for. If missing, the full list of holidays will be returned.
[out]retVal(Optional) The functions returns a (:_:) separated list of holiday names.
[in,out]nLen(Required) 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 holidays 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.
  1. If the value of nLen is NULL, the function will fail and return NDK_INVALID_ARG as error code.
  2. 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.
  3. If the value of the argDate argument does not correspond to a valid date serial number, the function will fails and return NDK_INVALID_VALUE 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_HLDYDate()

int __stdcall SFDB_HLDYDate ( LONG argDate,
LPLONG zDates,
size_t nLen,
LPCTSTR argHolidays,
WORD retType,
LPLONG retVal )

Returns the date serial number that represents the holiday in the given year.

Parameters
[in]argDate(Required) The serial date number that represents the given date
[in]zDates(Optional) An array of holidays dates; each expressed as a serial number (i.e. number of days since 1.1.1970)
[in]nLen(Required) The number of dates in zDates.
[in]argHolidays(Optional) A (:_:) separated list of holiday names, calendars, countries or currency.
[in]retType(Optional) A switch to select the return output (1 = next holiday, 2= last holiday).
[out]retVal(Required) The functions returns the serial date number that represents the holiday.
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 holidays 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 the argDate argument does not correspond to a valid date serial number, the function will fails and return NDK_INVALID_VALUE as error code.
  5. If the value of retVal 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_HLDYDates()

int __stdcall SFDB_HLDYDates ( LONG argStartDate,
LONG argEndDate,
LPLONG zDates,
size_t nLen,
LPCTSTR szHolidays,
LPLONG retVal,
size_t * nSize )

Return an array of serial date numbers that represent observed holidays between the two given dates.

Parameters
[in]argStartDate(Required) a serial date number that represents start date.
[in]argEndDate(Required) a serial date number that represents finish date.
[in]zDates(Optional) An array of holidays dates; each expressed as a serial number (i.e. number of days since 1.1.1970)
[in]nLen(Required) The number of dates in zDates.
[in]szHolidays(Optional) A (:_:) separated list of holiday codes.
[out]retVal(Optional) an array for the holiday dates.
[in,out]nSize(Required) maximum number of elements in the output array.
Returns
status code of the function call: zero = success, positive = success with a warning, and negative = error occurred.

Return the date serial number that represents the holiday in the given year.

Return values
NDK_SUCCESSsuccess
NDK_INVALID_ARGfailed (see remarks)
NDK_INVALID_VALUEfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The list of holidays 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 the argStartDate argument does not correspond to a valid date serial number, the function will fails and return NDK_INVALID_VALUE as error code.
  5. If the value of the argEndDate argument does not correspond to a valid date serial number, the function will fails and return NDK_INVALID_VALUE as error code.
  6. If the value of nSize is NULL, the function will fail and return NDK_INVALID_ARG as error code. 7 If retVal is NULL, the function returns NDK_SUCCESS and stores the required size of the data, in the variable pointed to by nSize. This enables an application to determine the best way to allocate a buffer for the value's data.
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_HLDYName()

int __stdcall SFDB_HLDYName ( LPCTSTR code,
LPTSTR retVal,
size_t * nLen )

Returns the full name of the holiday that corresponds to the given short code

Parameters
[in]code(Required) The the given holiday short code
[out]retVal(Optional) The functions returns the long holiday names.
[in,out]nLen(Required) 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 holidays 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 nLen is NULL, the function will fail and return NDK_INVALID_ARG as error code.
  5. 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.
  6. If the value of code is NULL or an 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

◆ SFDB_HLDYS()

int __stdcall SFDB_HLDYS ( LPCTSTR argPrefix,
LPTSTR retVal,
size_t * nLen )

Search for and provide a list of holiday codes that match the specified prefix.

Parameters
[in]argPrefix(Required) the holiday name/prefix to search for. If missing, the full list of holidays will be returned.
[out]retVal(Optional) The functions returns a (:_:) separated list of holiday names.
[in,out]nLen(Required) 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_LENGTH_ERRORfailed (see remarks)
NDK_FAILEDfailed
Remarks
  1. The list of holidays 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 nLen is NULL, the function will fail and return NDK_INVALID_ARG as error code.
  5. 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.
  6. If the value of argPrefix is NULL or empty, the function will return the list of all supported holidays.
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_ISHLDY()

int __stdcall SFDB_ISHLDY ( LONG argDate,
LPLONG zDates,
size_t nLen,
LPCTSTR argHolidays )

Determine if the specified date falls on a holiday (TRUE/FALSE).

Parameters
[in]argDate(Required) The serial date number that represents the given date
[in]zDates(Optional) An array of holidays dates; each expressed as a serial number (i.e. number of days since 1.1.1970)
[in]nLen(Required) The number of dates in zDates.
[in]argHolidays(Optional) A (:_:) separated list of holiday codes
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 holidays 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 the argDate argument does not correspond to a valid date serial number, the function will fails and return NDK_INVALID_ARG as error code.
  5. If the value of argHoliday is NULL, the function will revert to USA calendar (and ignore the zDates).
  6. If the value of argHoliday is not NULL, but one of more holidays are not recognized or supported, the function will fail and return NDK_FAILED as an 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_ISVALIDHLDYCODE()

int __stdcall SFDB_ISVALIDHLDYCODE ( LPCTSTR argHoliday)

Examine the validity of the given code as a holiday code.

Parameters
[in]argHoliday(Required) the given holiday code.
Returns
status code of the function call: zero = success, positive = success with a warning, 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 holidays 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 argHoliday 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_ONEHLDYDates()

int __stdcall SFDB_ONEHLDYDates ( LONG argStartDate,
LONG argEndDate,
LPCTSTR szHoliday,
LPLONG retVal,
size_t * nSize )

Generate an array of serial date numbers for the given holiday between two specified dates.

Parameters
[in]argStartDate(Required) a serial date number that represents start date.
[in]argEndDate(Required) a serial date number that represents finish date.
[in]szHoliday(Required) A a holiday code (e.g., USA-MLK, CHN-CNY).
[out]retVal(Optional) an array for the holiday dates.
[in,out]nSize(Required) maximum number of elements in the output array.
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 holidays 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 the argStartDate argument does not correspond to a valid date serial number, the function will fails and return NDK_INVALID_VALUE as error code.
  5. If the value of the argEndDate argument does not correspond to a valid date serial number, the function will fails and return NDK_INVALID_VALUE as error code.
  6. If the value of nSize is NULL, the function will fail and return NDK_INVALID_ARG as error code.
  7. If retVal is NULL, the function returns NDK_SUCCESS and stores the required size of the data, in the variable pointed to by nSize. This enables an application to determine the best way to allocate a buffer for the value's data.
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