www.delorie.com/djgpp/doc/libc/libc_178.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

_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

ANSI/ISO C No
POSIX No

Example

 
struct dosdate_t date;

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


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004