我試圖將時間結構轉換爲FAT時間戳。我的代碼如下所示:Unix時間戳到FAT時間戳
unsigned long Fat(tm_struct pTime)
{
unsigned long FatTime = 0;
FatTime |= (pTime.seconds/2) >> 1;
FatTime |= (pTime.minutes) << 5;
FatTime |= (pTime.hours) << 11;
FatTime |= (pTime.days) << 16;
FatTime |= (pTime.months) << 21;
FatTime |= (pTime.years + 20) << 25;
return FatTime;
}
是否有人擁有正確的代碼?
你的問題是什麼? – 2013-04-02 11:55:13