DosSetDateTime (1.2)
◄Function Group► ◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
#define INCL_DOSDATETIME
USHORT DosSetDateTime(pdateTime)
PDATETIME pdateTime; /* pointer to structure for date and time */
The DosSetDateTime function sets the current date and time. Although MS OS/2
maintains the current date and time, any process can change the date and
time by using the DosSetDateTime function.
The DosSetDateTime function is a family API function.
Parameter Description
────────────────────────────────────────────────────────────────────────────
pdateTime Points to the structure that contains the date and time
information.
Return Value
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be the following:
ERROR_TS_DATETIME
Example
This example retrieves the current date and time and then calls the
DosSetDateTime function to change the month to September and the day to the
26th:
DATETIME dateTime;
DosGetDateTime(&dateTime); /* gets the current date and time */
dateTime.month = 9; /* changes the month */
dateTime.day = 26; /* changes the day */
DosSetDateTime(&dateTime); /* sets the new date and time */
See Also
DosGetDateTime, DATETIME
♦