WYRDTEK Home Features Reference Downloads About


The es_date interface provides date arithmetic functionality. This includes the ability to add or subtract days and months to a date, to take the difference in days between any two dates and to compute the day of the week that a particular date falls on.

The date calculator must be initialized with respect to a range of years via a call to es_date_init(). Only dates within this range are subsequently valid.

es_date can convert a date supplied in either composite (i.e. YYYYMMDD) or individual (seperate year, month and day) format to a date-id and back again. A date-id is an unsigned integer representing a date as the number of days from January 1st of the beginning year in the valid range.

Calendar days can be added to or subtracted from a date by simply adding to or subtracting from a date-id.

The interface functions are as follows:
es_date_init Initializes date calculator.
es_date_destroy Destroys date calculator and cleans up resources.
es_date_getlowyear Get lowest year in calculator range.
es_date_gethighyear Get highest year in calculator range.
es_date_getid_c Convert date in composite format (YYYYMMDD) to a date-id.
es_date_getid_i Convert date in individual format (years, months and days) to a date-id.
es_date_addmonths Add or subtract a number of months to a date-id.
es_date_getyear Get year corresponding to a date-id.
es_date_getmonth Get month corresponding to a date-id.
es_date_getday Get day-of-month corresponding to a date-id.
es_date_getcomp Convert date-id to a date in composite format (YYYYMMDD).
es_date_getdow Get day-of-week corresponding to a date-id.
es_date_getmaxid Get maximum valid date-id in calculator range.

[Back To Reference]