Xref: utzoo comp.sys.ibm.pc:36793 comp.lang.c:23178 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!ginosko!usc!srhqla!quad1!few From: few@quad1.quad.com (Frank Whaley) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: Re: findfirst/findnext in Turbo C Message-ID: <3539@gouda.quad.com> Date: 24 Oct 89 00:03:01 GMT References: <3540@orion.cf.uci.edu> Reply-To: few@gouda.quad.com (Frank Whaley) Distribution: na Organization: Quadratron Systems, Westlake Village, CA Lines: 33 In article <3540@orion.cf.uci.edu> dkrause@orion.oac.uci.edu (Doug Krause) writes: >I'm using Turbo C 2.0 on a PC clone. My question: I'm using findfirst >and findnext to read the disk directory. In the structure returned are >two integers that tell the file date and file time. Is there a function >to convert these numbers into something more useful like hh:mm? Sure, sprintf()... assuming a filled-in struct ffblk F: sprintf(buf, "%02d/%02d/%02d %02d:%02d", (F.ff_fdate >> 5) & 0xf, F.ff_fdate & 0x1f, (F.ff_fdate >> 9) + 80, (F.ff_ftime >> 11) & 0x1f, (F.ff_ftime >> 5) & 0x3f); Of course, also assuming American date format :-) Another interesting (hidden) function is: extern long pascal __DOSTIMETOU(unsigned date, unsigned time); which takes a MS-DOS directory date/time and turns it into a Un*x-like time value. -- Frank Whaley Senior Development Engineer Quadratron Systems Incorporated few@quad1.quad.com uunet!ccicpg!quad1!few Water separates the people of the world; Wine unites them.