silverfrost Site Admin
Joined: 29 Nov 2006 Posts: 191 Location: Manchester
|
Posted: Tue Sep 07, 2004 9:56 pm Post subject: Reading DOS compressed date/time |
|
|
Summary
Certain ClearWin+ functions, including FILES@, return file date/time information as compressed DOS format in integer(kind=2).
Solution
The date can be extracted into day/month/year components from such an integer using:
Code: | integer date_day, date_month, date_year
date_day = ibits(date(1), 0, 5)
date_month = ibits(date(1), 5, 4)
date_year = 1980 + ibits(date(1), 9, 7) |
where date(1) is the integer(kind=2) containing the compressed file date information.
The time can be extracted into hour/minute/second components using:
Code: | integer time_second, time_minute, time_hour
time_second = ibits(time(1), 0, 5)*2
time_minute = ibits(time(1), 5, 6)
time_hour = ibits(time(1), 11, 5) |
where time(1) is the integer(kind=2) containing the compressed file time information. |
|