KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q31561: Time and Date from _dos_findfirst(), _dos_findnext()

Article: Q31561
Product(s): See article
Version(s): 5.00 5.10 6.00 6.00a
Operating System(s): MS-DOS
Keyword(s): ENDUSER | | mspl13_c
Last Modified: 15-JAN-1991

The 2-byte return values of the time and date fields returned by
_dos_findfirst and _dos_findnext are divided into bit ranges that must
be translated to meaningful values. This translation is usually done
by combinations of masking and right-shifts (>>).

The following is the time field:

   Bits 0BH-0FH = hours (0 through 23)
   Bits 05-0AH  = minutes (0 through 59)
   Bits 00-04H  = number of 2-second increments (0 through 29)

The following is the date field:

   Bits 09-0FH  = year (relative to 1980)
   Bits 05-08H  = month (0 through 12)
   Bits 00-04H  = day of month (0 through 31)

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.