Page 1 of 1

FAT date

Posted: Sat Jul 09, 2005 11:31 am
by GLneo
hi all, how do you convert the "short" value of time and date in a fat fat entery?, thx :)

Re:FAT date

Posted: Sat Jul 09, 2005 11:41 am
by AR
I suggest you get the FAT Docs. According to the Docs:
Date Format. A FAT directory entry date stamp is a 16-bit field that is basically a date relative to the MS-DOS epoch of 01/01/1980. Here is the format (bit 0 is the LSB of the 16-bit word, bit 15 is the MSB of the 16-bit word):

Bits 0?4: Day of month, valid value range 1-31 inclusive.
Bits 5?8: Month of year, 1 = January, valid value range 1?12 inclusive.
Bits 9?15: Count of years from 1980, valid value range 0?127 inclusive (1980?2107).

Time Format. A FAT directory entry time stamp is a 16-bit field that has a granularity of 2 seconds. Here is the format (bit 0 is the LSB of the 16-bit word, bit 15 is the MSB of the 16-bit word).

Bits 0?4: 2-second count, valid value range 0?29 inclusive (0 ? 58 seconds).
Bits 5?10: Minutes, valid value range 0?59 inclusive.
Bits 11?15: Hours, valid value range 0?23 inclusive.