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++ 3.0r4 - <b>dos_setdate</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
dos_setdate

Usage

   #include <dos.h>
   int dos_setdate(struct dos_date_t *date):

Description

   Sets the current date via a call to DOS function 0x2b (43) to the values
   passed in the structure pointed to by date. The format of this structure

   is  as follows:

   struct dos_date_t
   {
       char    day;            /* day of month(1-31)    */
       char    month;      /* month (1-12)          */
       int year;           /* year (1980-2099)      */
       char    dayofweek;  /* day of week (0 = Sunday) */
   }

Example 

   #include <stdio.h>
   #include <dos.h>
   #include <stdlib.h>

   int main()
   {
       struct dos_date_t date;
       int oy;


       dos_getdate(&date);
       printf("Date is %02d/%02d/%d (day of week %d)\n"
           ,date.month,date.day,date.year,date.dayofweek);

       oy = date.year;
       date.year = 1991;
       dos_setdate(&date);
       dos_getdate(&date);
       printf("\nDate is %02d/%02d/%d (day of week %d)\n"
           ,date.month,date.day,date.year,date.dayofweek);

       date.year = oy;
       dos_setdate(&date);
       dos_getdate(&date);
       printf("\nDate is %02d/%02d/%d (day of week %d)\n"
           ,date.month,date.day,date.year,date.dayofweek);
       return EXIT_SUCCESS;
   }


Return Value

   0 if successful, otherwise returns non zero if the date passed was
   invalid.

See Also

   DOS package, dos_getdate, dos_settime, dos_gettime



See Also: dos_getdate dos_settime dos_gettime

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