Product Documentation

c-treeDB API API for C

Previous Topic

Next Topic

ctdbDateCheck

Check if a given date is valid.

Declaration

CTDBRET ctdbDateCheck(NINT year, NINT month, NINT day)

Description

ctdbDateCheck() checks to see if the given date is valid. To check if the time is valid, use ctdbTimeCheck().

  • year [in] the year, and it is supposed to be ≥ 0.
  • month [in] the month, and it supposed to be in the range 1 ≤ month ≤ 12.
  • day [in] the day, and it supposed to be in the range 1 ≤ day ≤ 28, or 29, or 30, or 31, depending on the month and year.

Returns

ctdbDateCheck() returns CTDBRET_OK if date is ok, or c-treeDB API error on failure.

The possible errors associated with ctdbDateCheck() are:

  • CTDBRET_INVYEAR (4032): Invalid year
  • CTDBRET_INVMONTH (4031): Invalid month
  • CTDBRET_INVDAY (4030): Invalid day

See also

ctdbTimeCheck()

TOCIndex