Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - dos_settime http://www.X-Hacker.org [<<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
   {
   charhour;
   /* hours (0-23) */
   charminute;
   /* minutes (0-59) */
   charsecond;
   /* seconds (0-59) */
   charhsecond;
   /* hundredths of a second (0-99) */
   }
   Example
   #include <stdio.h>
   #include <dos.h>

   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 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

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson