# RTC_SetDateAsync

## Syntax

  `#include <nitro/rtc.h>`

      RTCResult RTC_SetDateAsync(
                  const RTCDate*    date,
                  RTCCallback       callback,
                  void*             arg );

## Arguments

date | Pointer to the buffer storing date data.
callback | Pointer to the callback function. This callback is called from within the interrupt handler.
arg | Argument to pass to the callback function.

## Return Values

If the request succeeds, it returns 0. If the request fails, it returns a numeric value other than 0.

## Description

This function asynchronously writes date data to the real-time clock. It sends date data to ARM7 and returns the process result without waiting for a response from the processor. To get the result from the processor, you must use the `result` argument. If this function fails, no operation is performed and no user callback function is called.

## Note

Do not define parameter values of nonexistent years, months, or days. However, you may specify a day of the week that does not match the actual calendar. Values are written to the variable specified by the date argument asynchronously with respect to this function. Do not use this variable for anything else until a user callback function confirms the completion of this asynchronous operation.
Because applications cannot change the date, use this function only for debugging during development.
In FINALROM builds, this function always fails and `RTC_RESULT_INVALID_COMMAND` is returned.

## See Also

`RTC_SetDate
RTC_GetDate
RTC_GetDateAsync
RTCResult
RTCDate
RTCCallback`

## Revision History

2009/07/29 Explained that the time setting command always fails in FINALROM builds.
2005/06/27 Added text indicating that the callback is invoked from the interrupt handler.
2004/05/18 Initial version.

CONFIDENTIAL