home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
463.lha
/
Date_routines
/
unpackdate.c
< prev
next >
Wrap
Text File
|
1991-01-04
|
708b
|
24 lines
/*****
unpackdate()
This function unpacks the date from an unsigned integer, using the
DOS disk format with bits: 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
int num the packed number
Return value: void
*****/
void unpackdate(int *day, int *month, int *year, unsigned int num)
{
*day = num & 0x1f;
*month = (num & 0x1e0) >> 0x05;
*year = (num & 0xfe00) >> 0x09;
*year += 1980; /* Add offset back in */
}