functions for calendar date calculations. More...
Functions | |
int __stdcall | SFDB_EDATE (LONG argDate, LPCTSTR szPeriod, PLONG retVal) |
computed the date after a given a period (e.g. 1w, 1m, 3w, etc.) | |
int __stdcall | SFDB_NWKDAY (WORD weekdy, short order, WORD mnth, WORD year, PLONG retVal) |
Returns the serial number of the n-th weekday in a month. | |
int __stdcall | SFDB_WKDYOrder (LONG argDate, short *retVal) |
Returns the order of the weekday in the month for a given date. This is the inverse operator of SFDB_NWKDAY(). | |
int __stdcall | SFDB_WEEKDAY (LONG argDate, WORD argReturnType, LPWORD retVal) |
Returns the day of the week corresponding to a date. The day is given as an integer, ranging from 1 (Sunday) to 7 (Saturday), by default.. | |
int __stdcall | SFDB_DTADJUST (LONG argDate, WORD argNextPrev, LPCTSTR holidays, LPLONG zDates, size_t nSize, WORD nWkndNo, LPLONG retVal) |
Examines whether the given date falls on a weekend or a holiday (i.e. non-working day), and returns the nearest working business day using a Business Day Convention (BDC). | |
int __stdcall | SFDB_ISWRKDY (LONG argDate, LPCTSTR holidays, LPLONG zDates, size_t nSize, WORD nWkndNo) |
Examines a given date for weekends and holidays (non-working days), and returns FALSE if it falls on a non-working day; otherwise it returns TRUE. | |
int __stdcall | SFDB_NETWRKDYS (LONG argStartDate, LONG argEndDate, LPCTSTR holidays, LPLONG zDates, size_t nSize, WORD nWkndNo, int *retVal) |
Returns the number of whole working days between two dates (inclusive). Working days exclude weekends and any date identified as a holiday. | |
int __stdcall | SFDB_WORKDAY (LONG argDate, short nDays, LPCTSTR holidays, LPLONG zDates, size_t nSize, WORD nWkndNo, LPLONG retVal) |
Returns the serial date number that represents the date that falls after the start date by a given number of working days. | |
int __stdcall SFDB_DTADJUST | ( | LONG | argDate, |
WORD | argNextPrev, | ||
LPCTSTR | holidays, | ||
LPLONG | zDates, | ||
size_t | nSize, | ||
WORD | nWkndNo, | ||
LPLONG | retVal ) |
[in] | argDate | (Required) The serial date number that represents the given date |
[in] | argNextPrev | (Required) the Business Day Convention (BDC): 1=Following, 2=Following Modified, 3=Preceding, 4=Preceding Modified, 5=Unadjusted (default). |
[in] | holidays | (Optional) A (:_:) separated list of holiday names, calendars, countries or currency. |
[in] | zDates | (Optional) An array of holidays dates; each expressed as a serial number (i.e. number of days since 1.1.1970) |
[in] | nSize | (Required) The number of dates in zDates . |
[in] | nWkndNo | (Optional) is the weekend number (1-7,11-17). If 0, the western weekend (i.e. 1, "Saturday, Sunday") is used. |
[out] | retVal | (Required) The functions returns the date of the nearest business day. |
NDK_SUCCESS | success |
NDK_FAILED | error |
calculate the date of the next (or previous) period using a day-counting convention to handle dates that fall on weekend and holidays.
Target Platform | Windows |
Header | SFDBM.h (include Windows.h) |
Library | SFDBM.lib |
DLL | SFDBM.dll |
int __stdcall SFDB_EDATE | ( | LONG | argDate, |
LPCTSTR | szPeriod, | ||
PLONG | retVal ) |
[in] | argDate | (Required) Is the base filename of the database file |
[in] | szPeriod | (Optional) Is the description of a period range (e.g. "5-days", "1 month", "1m", "3 w", "-1 year"). |
[out] | retVal | (Required) is the calculated date that falls after the given period. |
NDK_SUCCESS | success |
NDK_FAILED | error |
advance the date by the given period and return that date
Target Platform | Windows |
Header | SFDBM.h (include Windows.h) |
Library | SFDBM.lib |
DLL | SFDBM.dll |
int __stdcall SFDB_ISWRKDY | ( | LONG | argDate, |
LPCTSTR | holidays, | ||
LPLONG | zDates, | ||
size_t | nSize, | ||
WORD | nWkndNo ) |
[in] | argDate | (Required) The serial date number that represents the given date |
[in] | holidays | (Optional) A (:_:) separated list of holiday names, calendars, countries or currency. |
[in] | zDates | (Optional) An array of holidays dates; each expressed as a serial number (i.e. number of days since 1.1.1970) |
[in] | nSize | (Required) The number of dates in zDates . |
[in] | nWkndNo | (Optional) is the weekend number (1-7,11-17). If 0, the western weekend (i.e. 1, "Saturday, Sunday") is used. |
NDK_SUCCESS | success |
NDK_FAILED | error |
examine whetehr a give data is a workday or not.
Target Platform | Windows |
Header | SFDBM.h (include Windows.h) |
Library | SFDBM.lib |
DLL | SFDBM.dll |
int __stdcall SFDB_NETWRKDYS | ( | LONG | argStartDate, |
LONG | argEndDate, | ||
LPCTSTR | holidays, | ||
LPLONG | zDates, | ||
size_t | nSize, | ||
WORD | nWkndNo, | ||
int * | retVal ) |
[in] | argStartDate | (Required) a serial date number that represents start date. |
[in] | argEndDate | (Required) a serial date number that represents finish date. |
[in] | holidays | (Optional) A (:_:) separated list of holiday names, calendars, countries or currency. |
[in] | zDates | (Optional) An array of holidays dates; each expressed as a serial number (i.e. number of days since 1.1.1970) |
[in] | nSize | (Required) The number of dates in zDates . |
[in] | nWkndNo | (Optional) is the weekend number (1-7,11-17). If 0, the western weekend (i.e. 1, "Saturday, Sunday") is used. |
[out] | retVal | (Required) The functions returns the number of work days in the given period. |
NDK_SUCCESS | success |
NDK_FAILED | error |
Target Platform | Windows |
Header | SFDBM.h (include Windows.h) |
Library | SFDBM.lib |
DLL | SFDBM.dll |
int __stdcall SFDB_NWKDAY | ( | WORD | weekdy, |
short | order, | ||
WORD | mnth, | ||
WORD | year, | ||
PLONG | retVal ) |
[in] | weekdy | (Required) A weekday (i.e. 1=Sunday, 2=Monday, 3=Tuesday, ..., 7=Saturday) |
[in] | order | (Required) the n-th occurence in the month (i.e. 1=First, 2=Second, 3=Third, 4=Fourth and -1=Last). |
[in] | mnth | (Required) the month in the year expressed as a number (i.e. 1=Jan, 2=Feb, ..., 12=Dec). |
[in] | year | (Required) the target year (2 or 4 digits) (e.g. 99, 2007, 2008, 09, etc.). |
[out] | retVal | (Required) The functions return the calculated serial number of the n-th weekday in a month/year. |
NDK_SUCCESS | success |
NDK_FAILED | error |
return the date of the n-th weekday in a given month and year.
Target Platform | Windows |
Header | SFDBM.h (include Windows.h) |
Library | SFDBM.lib |
DLL | SFDBM.dll |
int __stdcall SFDB_WEEKDAY | ( | LONG | argDate, |
WORD | argReturnType, | ||
LPWORD | retVal ) |
[in] | argDate | (Required) The serial date number that represents the given date |
[in] | argReturnType | (Required) a number that designates the weekdays coding (or ordering) scheme. If missing, convention=1 (Sun=1,..,Sat=7) is assumed. |
[out] | retVal | (Required) The functions returns the day of the week corresponding to a date |
NDK_SUCCESS | success |
NDK_FAILED | error |
return the numeric representation of the weekday for a given convention
Target Platform | Windows |
Header | SFDBM.h (include Windows.h) |
Library | SFDBM.lib |
DLL | SFDBM.dll |
int __stdcall SFDB_WKDYOrder | ( | LONG | argDate, |
short * | retVal ) |
[in] | argDate | (Required) The serial date number that represents the given date |
[out] | retVal | (Required) The functions returns the order of the weekday in the month for a given date. |
NDK_SUCCESS | success |
NDK_FAILED | error |
return the order of the weekday of a given date in that month.
Target Platform | Windows |
Header | SFDBM.h (include Windows.h) |
Library | SFDBM.lib |
DLL | SFDBM.dll |
int __stdcall SFDB_WORKDAY | ( | LONG | argDate, |
short | nDays, | ||
LPCTSTR | holidays, | ||
LPLONG | zDates, | ||
size_t | nSize, | ||
WORD | nWkndNo, | ||
LPLONG | retVal ) |
[in] | argDate | (Required) The serial date number that represents the given date |
[in] | nDays | (Required) A number of workdays to advance |
[in] | holidays | (Optional) A (:_:) separated list of holiday names, calendars, countries or currency. |
[in] | zDates | (Optional) An array of holidays dates; each expressed as a serial number (i.e. number of days since 1.1.1970) |
[in] | nSize | (Required) The number of dates in zDates . |
[in] | nWkndNo | (Optional) is the weekend number (1-7,11-17). If 0, the western weekend (i.e. 1, "Saturday, Sunday") is used. |
[out] | retVal | (Required) The functions returns the serial date number after a given number of working days. |
NDK_SUCCESS | success |
NDK_FAILED | error |
Target Platform | Windows |
Header | SFDBM.h (include Windows.h) |
Library | SFDBM.lib |
DLL | SFDBM.dll |