DosSetDateTime sets the date and time that are maintained by the operating system.
The system verifies that the day is possible for the month and year (even for leap year) and that the values specified for the parameters are within their respective limits; if either of these conditions is violated, ERROR_TS_DATETIME is returned.
To get the date and time, issue DosGetDateTime.