Go to the first, previous, next, last section, table of contents.


_dos_setdate

Syntax

#include <dos.h>

unsigned int _dos_setdate(struct dosdate_t *date);

Description

This function sets the current date. The dosdate_t structure is as follows:

struct dosdate_t {
  unsigned char  day;       /* 1-31          */
  unsigned char  month;     /* 1-12          */
  unsigned short year;      /* 1980-2099     */
  unsigned char  dayofweek; /* 0-6, 0=Sunday */
};

dayofweek field has no effect at this function call.

See section _dos_getdate. See section _dos_gettime. See section _dos_settime.

Return Value

Returns 0 if successful and non-zero on error (and sets errno=EINVAL).

Portability

not ANSI, not POSIX

Example

struct dosdate_t date;

date->year  = 1999;
date->month = 12;
date->day   = 31;
if ( !_dos_setdate(&date) )
  puts("It was a valid date.");


Go to the first, previous, next, last section, table of contents.