home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
463.lha
/
Date_routines
/
unpacktime.c
< prev
next >
Wrap
Text File
|
1991-01-04
|
693b
|
24 lines
/*****
unpacktime()
This function collapses the time into an unsigned integer by using
the DOS disk format with bits: 0x00 - 0x04 = day, 0x05 - 0x08 = month,
0x09 - 0x0f = year. The year is formed relative to 1980 and can only
be used for dates after 12/31/79.
Argument list: int *sec the day
int *min the month
int *hour the hour
int num the packed number
Return value: void
*****/
void unpacktime(int *sec, int *min, int *hour, int num)
{
*sec = (num & 0x1f) * 2;
*min = (num & 0x7e0) >> 0x05;
*hour = (num & 0xf800) >> 0x0b;
}