home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
463.lha
/
Date_routines
/
packdate.c
< prev
next >
Wrap
Text File
|
1991-01-04
|
744b
|
32 lines
/*****
packdate()
This function collapses the date into an unsigned integer using the
DOS disk format: 0x00 - 0x04 = day, 0x05 - 0x08 = month, 0x09 - 0x0f =
year. The year is formed relative to 1980.
Argument list: int day the day
int month the month
int year the year
Return value: unsigned int
*****/
unsigned int packdate(int day, int month, int year)
{
unsigned result = 0;
result = day;
month <<= 0x05;
if (year < 100) /* No century given? */
year -= 80;
else
if (year >= 1980)
year -= 1980;
year <<= 0x09;
result += month;
result += year;
return result;
}