AdjustCalendarDate function

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


BOOL AdjustCalendarDate(
  _Inout_ LPCALDATETIME        lpCalDateTime,
  _Out_   INT                  amount


lpCalDateTime [in, out]

Pointer to a CALDATETIME structure that contains the date and calendar information to adjust.

calUnit [in]

The CALDATETIME_DATEUNIT enumeration value indicating the date unit, for example, DayUnit.

amount [out]

The amount by which to adjust the specified date.

Return value

Returns TRUE if successful or FALSE otherwise. To get extended error information, the application can call GetLastError, which can return one of the following error codes:

  • ERROR_DATE_OUT_OF_RANGE. The specified date was out of range.
  • ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.


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


Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]



See also

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