AdjustCalendarDate

Adjusts a date by a specified number of years, months, weeks or days.

BOOL AdjustCalendarDate(LPCALDATETIME lpCalDateTime,CALDATETIME_DATEUNIT calUnit,INT amount);

Parameters

  • lpCalDateTime
    [in,out] Pointer to a CALDATETIME structure that contains the date and calendar information to be adjusted.
  • calUnit
    [in] The CALDATETIME_DATEUNIT to be adjusted (years, months, weeks or days).
  • amount
    [out] The amount to adjust the given date by.

Return Values

Returns TRUE if successful. FALSE, otherwise.

Remarks

To get extended error information, call GetLastError, which can return one of the following error codes:

  • ERROR_INVALID_PARAMETER
  • ERROR_DATE_OUT_OF_RANGE

This function does not have an associated header or library file. Call LoadLibrary with the DLL name (Kernel32.dll) to obtain a module handle. Then call GetProcAddress with that module handle and this function name to get the address of this function.

This function is deprecated and will be unavailable in subsequent versions.

Requirements

**  Windows NT/2000/XP/Vista:** Windows Vista only.
**  Windows 95/98/Me:** Unsupported.
**  Implementation:** Implemented by Kernel32.dll.

See Also

National Language Support, National Language Support Functions, NLS: Name-based APIs Sample