Path: utzoo!utgpu!water!watmath!clyde!rutgers!umd5!purdue!gatech!hao!noao!arizona!naucse!wew From: wew@naucse.UUCP (Bill Wilson) Newsgroups: comp.lang.c Subject: Re: Turbo C Date Conversion Summary: Turbo C and dates Keywords: Turbo C, date Message-ID: <541@naucse.UUCP> Date: 21 Jan 88 19:17:52 GMT References: <454@picuxa.UUCP> Organization: Northern Arizona University, Flagstaff, AZ Lines: 23 In article <454@picuxa.UUCP>, rcr@picuxa.UUCP (Richard Court ) writes: > I am writing a program to list directory attributes. I am using the > "findfirst" and "findnext" routines to extract file information for me > and then "strcpy" data out of the "ffblk" structure to fill my arrays. > > What I can't figure out is how to convert the file date and time. They > are placed in the ffblk structure as packed integers and I'll be damned > if I can figure out a way to get them into strings! Norton's "Programmer's Guide to the IBM PC" may be a great help to you when working on PC systems type programs. To decode the date try the following algorithm: d=dosdate and 31 m=(dosdate shr 5) and 15 y=(dosdate shr 9) + 1980 For the time: min=(dostime(shr 5) and 63 hour=(dostime shr 11) You'll have to transalte this psuedo code into C. Bill Wilson