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_setdate 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 time. The format of  this
   structure is as follows:

   struct dos_date_t
   {
   charday;
   /* day of month(1-31) */
   charmonth;
   /* month (1-12) */
   intyear;
   /* year (1980-2099) */
   chardayofweek;
   /* day of week (0 = Sunday) */
   }
   Example
   #include <stdio.h>
   #include <dos.h>

   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 Value
   0  if  successful, otherwise returns non zero if the date  passed  was
   invalid.


See Also: DOS_Package dos_getdate dos_settime dos_gettime

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