
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>dos_settime</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
dos_settime
Usage
#include <dos.h>
int dos_settime(struct dos_time_t *time);
Description
Sets the current system via a call to DOS function 0x2d (45) to the
values passed in the structure pointed to by time. The format of this
structure is as follows:
struct dos_time_t
{
char hour; /* hours (0-23) */
char minute; /* minutes (0-59) */
char second; /* seconds (0-59) */
char hsecond; /* seconds/100 (0-99) */
}
Example
#include <stdio.h>
#include <dos.h>
#include <stdlib.h>
int main()
{
struct dos_time_t time;
char oh;
dos_gettime(&time);
printf("Time is %02d:%02d:%02d:%02d\n",
time.hour,time.minute,time.second,time.hsecond);
oh = time.hour;
time.hour = 4;
dos_settime(&time);
dos_gettime(&time);
printf("Time is %02d:%02d:%02d:%02d\n",
time.hour,time.minute,time.second,time.hsecond);
time.hour = oh;
dos_settime(&time);
dos_gettime(&time);
printf("Time is %02d:%02d:%02d:%02d\n",
time.hour,time.minute,time.second,time.hsecond);
return EXIT_SUCCESS;
}
Return Value
0 if successful, otherwise returns the DOS error code if the time passed
was invalid.
See Also
DOS package, dos_settime, dos_setdate dos_getdate
See Also: dos_settime dos_setdate dos_getdate
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson