home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Beijing Paradise BBS Backup
/
PARADISE.ISO
/
software
/
BBSDOORW
/
EZY110-1.ARJ
/
STRUCT.ARJ
/
CLIB.ARJ
/
DATE2.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-28
|
582b
|
23 lines
#include <ezycom.h>
#include <ezylib.h>
/**********************************************************
* Convert a Date to a Word
*
* Returns the converted date on success or 65535 on failure.
*
* eg: worddate = date2word(1992,1,1);
**********************************************************/
word Date2Word(word yy, word mm, word dd)
{
word tofield=0;
if (!CheckDate(yy,mm,dd) || yy < 1980 || yy > 2107) return(65535U);
tofield = dd-1;
tofield = tofield + ((mm-1) << 5);
tofield = tofield + ((yy-1980) << 9);
return(tofield);
}